 SOLVED

# IF Formula help

I am trying to insert the following formula and it keeps coming back with I am entering to many arguments.  If anyone has a solution as to how I can get this to work that would be great. =IF(B6="Yes",(B5*1.25*B21),B7="Yes",(B5*1.15*B21),(B21*B5)

What I am trying to achieve is - if cell B6 equals yes use X calculation, or If B7 equals yes use Y calculation, otherwise use Z calculation.

Any suggestions would be appreciated

6 Replies

# Re: IF Formula help

If has only two outcome TRUE or FALSE
you need to add one more IF
so your formula will be if (some condition, True, Otherwise (some other condition, True do something, False do something else))

=IF(B6="Yes",(B5*1.25*B21),IF(B7="Yes",(B5*1.15*B21),(B21*B5)))

best response confirmed by JPas06 (New Contributor)
Solution

# Re: IF Formula help

On the most recent versions of Excel it is possible to use an IFS function

``````= IFS(
B6="Yes", (B5*1.25*B21),
B7="Yes", (B5*1.15*B21),
TRUE,     (B21*B5)
)``````

Here, I have also used Alt/Enter to split the formula over a number of lines to aid readability.

# Re: IF Formula help

@Peter Bartholomew Thank you Peter that is great and has solved by problem.  I knew it would be a simple step that I was missing.

# Re: IF Formula help

Thank you @Ramiz_Assaf for your response

# Re: IF Formula help

Go straight to the point  without IFs
=((1+B5*B21*(B6="Yes")*1.25)*(1+B5*B21*(B7="Yes")*1.15))-1

# Re: IF Formula help

Wow @Juliano-Petrukio
this is kinda complex for me!!