How many IF functions can you have?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following formula:
=IF(AND(S32="Yes",U32="Yes",W32="Yes",Y32="Yes"),Z32+AA32+AB32+AC32,IF(U32="",Z32,IF(U32="Yes",Z32+AA32,IF(W32="",Z32+AA32,IF(W32="Yes",Z32+AA32+AB32,IF(Y32="",Z32+AA32+AB32,IF(Y32="Yes",Z32+AA32+AB32+AC32,IF(M32="No",0))))))))

The problem is when W32 is "Yes". It does not add the totals in Z32,AA32, &
AB32. However, when S32, U32, W32, & Y32 = "Yes", then the total of all four
cells totals the correct total. There probably is an easier formula.
 
The Excel limit for nested IF is 7. Looks like you're right at the limit, so
you'll be ok as long as you don't add another IF. Nothing happens when your
5th IF (W32="Yes") is true, because you have already covered all the
possibilities by the 3rd IF (U32="Yes"). So basically no matter what the
combination of your 4 cells are, it will not go any further than the 3rd IF.

Don't really know how to correct the formula because I don't know what's the
exact conditions you want. Maybe if you write it out in words I can figure
out the formula to use.

-Simon
 
First of all you need to understand how excel makes it's calculations
In your formula you are telling excel to total cells Z, AA, AB, & AC 3
if cells S, U, W, & Y32 =YES. It does this correctly. In your next i
statement (next condition) you tell excel to total cell C32 if cell U3
is blank. It does this correctly because condition 1 is now no longe
true. In you next condition you telling excel to contidict it's self b
saying IF cell U32 equals YES, then total cells Z and AA 32. By puttin
Yes back in cell U32 unless I'm missing something now tell excel t
return to the first condition which should total 13 the sum of cells Z
AA, AB, & AC 32. You can have more than 7 nested if's however, you nee
to use =CONCATENATE. This will give you 30 conditions to use in you
formula. There is also a way to bypass the 30 conditions but that
another story. Try to be a little more specific as to what you want th
outcome to be. Hope this helps.

E
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

problem with formula 5
End If without Block If Error Help 6
Help with fixing formula 4
formula needs modification 4
VBA Code Help? 1
IF OR help 5
Adding using IF? 2
Help with another formula, please 3

Back
Top