SOLVED

IF Formula help

Copper Contributor

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
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 (Copper Contributor)
Solution

@JPas06 

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.

@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.

Thank you @Ramiz_Assaf for your response

@JPas06 

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

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

1 best response

Accepted Solutions
best response confirmed by JPas06 (Copper Contributor)
Solution

@JPas06 

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.

View solution in original post