Nov 03 2022 03:13 AM
Hi
How do I write an IF statement if I want it to look for different ranges and if that meets certain criteria to do a SUM calculation.
For example
So if range is 'Low' I want it to add 1.5% onto current column
if range is 'Mid' I want to add 1% onto current column
and if range is 'High' I want to add 0.5% onto current column
I have tried this formula but it errors saying the = looks like a formula and to add an apostrophe before = , so '= but this does not work either
=IF(AND(AB2 ="Low",(SUM(U2/V2)*SUM(Z2+1.5)%*12),IF(AND(AB2 ="Mid", (SUM(U2/V2)*SUM(Z2+1)%*12),IF(AND(AB2 ="High", (SUM(U2/V2)*SUM(Z2+0.5)%*12)))))))
I'm thinking i have not ut the brackets in correct place maybe......??? Help please
Thanks
Nov 03 2022 03:54 AM
Hi @SGeorgie
You have several issue, one of them the brackets, but this is not the main problem.
what is column Z that mention in the formula, is it the same column you want to put the formula? You can not write the formula and use the same cell inside the formula, that will make loop.
You should use the percentage in different way, such as %12 is 1.2
Nov 03 2022 04:00 AM
Nov 03 2022 04:01 AM
There is no need to use SUM in this formula.
In your screenshot, "Low" etc. is in column AA and Current is in column AB, but in your formula "Low" is in AB, while Current is in Z?
What is the AND for?
Why do you multiply with 12?
Nov 03 2022 04:04 AM
Nov 03 2022 04:20 AM
Nov 03 2022 04:25 AM
This is extremely confusing - you have now stated three different sets of columns.
Let's start from scratch. What is the amount you want to add 1.5%, 1% or 0.5% to?
Nov 03 2022 04:32 AM
Nov 03 2022 04:45 AM
SolutionIn AD2:
=AC2*IF(AB2="Low",101.5%,IF(AB2="Mid",101%,IF(AB2="High",100.5%)))
or
=AC2*IFS(AB2="Low",101.5%,AB2="Mid",101%,AB2="High",100.5%)
Nov 03 2022 05:16 AM
@Hans Vogelaar thanks ill give them a go, many thanks
Nov 04 2022 01:32 AM
@Hans Vogelaar That's brilliant, thank you. If there is a very low or very high or no comms range, and I want these to remain the same (ie no increase) how do i write that?
I tried IF(AB2="Very High",+0
but it automaticity removes the '+' sign and puts 0 as the answer
Thanks
Nov 04 2022 10:26 AM
So now i need to show if red and blue to look at range 1
if green and yellow to look at range 2
The range is on the Summary tab as shown
The formula as it stands is (which is looking at only 1 range name (low, mid or high etc but NOT based on colour range so all colours are mingled together)
=IF(AND($Z2>=Summary!$C$3,$Z2<=Summary!$D$3),"Low",IF(AND($Z2>=Summary!$C$4,$Z2<=Summary!$D$4),"Mid",IF(AND($Z2>=Summary!$C$5,$Z2<=Summary!$D$5),"High",IF(AND($Z2>Summary!$D$5),"Very High",IF(AND($Z2<Summary!$C$3,$Z2>0),"Very Low",IF(AND($Z2=0),"No Comm"))))))
So what i want if red and blue with Z being >=5 or <=9 "Low", mid >=9.01 <=12 etc
OR if green and yellow and Z being >=4 <=6 "Low", mid >=6.01 <=9.99 etc
I then need my Current and Potential comm columns to look at the column /ranges to apply the relevant % increase
Current formulas are
Current
=SUM($U2/$V2)*$Z2%*12
Potential
=$AC2*IFS($AB2="Low",(1+Summary!$E$3),$AB2="Mid",(1+Summary!$E$4),$AB2="High",(1+Summary!$E$5),$AB2="Very Low",100%,$AB2="Very High",100%,$AB2="No Comm",100%)
(these currently refer to Range 1 only
Nov 03 2022 04:45 AM
SolutionIn AD2:
=AC2*IF(AB2="Low",101.5%,IF(AB2="Mid",101%,IF(AB2="High",100.5%)))
or
=AC2*IFS(AB2="Low",101.5%,AB2="Mid",101%,AB2="High",100.5%)