Forum Discussion
Rosa Hernandez
Oct 04, 2017Copper Contributor
Excel Formula, combining two IF statements
I need to string together two IF statements, =IF(C7>=70, C7*0.5) and =IF(C7<=69, C7*0.65), please help
Bryant Boyer
Oct 04, 2017Brass Contributor
In general, it's good practice to arrange your IF statements into an IF, THEN, ELSE (If not) order. For instance,
If C7>=70
Then C7*0.5
Else (If not, then) C7*0.65
This always translates well to the IF function in Excel, which is IF("If" condition, "Then" condition, "Else" condition) or =IF(C7>=70,C7*0.5,C7*0.65)
Just be aware that it will always follow the first condition that meets the criteria, in this case multiplying it by 0.5.
Also take a look at IFS, which is good for multiple IF statements. The format is the condition followed by the action, followed by a new condition and subsequent action and on and on. For example,
=IFS(C7>70,C7*0.5,C7>60,C7*0.65,C7>50,C7*.73,C7>40,C7*.78,TRUE,C7*.82) (Where the "TRUE" will catch all cases that don't meet the other criteria).
Good luck!
SergeiBaklan
Oct 04, 2017MVP
And quite often better to avoid IF(S) even if that's first what we have in mind - Detlef gave good examples. Alternative could be more compact, effective and maintainable. Assume if in IFS from previous post we have some complex expression instead of C7.
- fuerteventuraspainOct 09, 2024Copper ContributorHi there,
how to join together two =if(and( formulas in excel
Please
=if(and(H26>=50,H27>=50,H28>=50,H29>=50,H30>=50,H31>=50,H32>=50),"groß","")
=if(and(H26<50,H27<50,H28<50,H29<50,H30<50,H51<50,H52<50),"klein","")- SergeiBaklanOct 10, 2024MVP
As variant
=IF( AND(H26>=50,H27>=50,H28>=50,H29>=50,H30>=50,H31>=50,H32>=50),"groß", IF( AND(H26<50,H27<50,H28<50,H29<50,H30<50,H51<50,H52<50), "klein", "" ) )
or
=IF( AND( H26:H32 >=50 ),"groß", IF( AND( H26:H32 < 50 ),"klein", "" ) )
- fuerteventuraspainOct 11, 2024Copper ContributorThanks