View Single Post
  #6   Report Post  
Ed
 
Posts: n/a
Default "IF" function - 7 nested limit

Hi Arvi
=IF(BP!S19=25,Cards!D25,IF(BP!S19=26,Cards!D26,IF( BP!S19=27,Cards!J1,IF(BP!S19=28,Cards!J2,IF(BP!S19 =29,Cards!J3,IF(BP!S19=30,Cards!J4,IF(BP!S19=31,Ca rds!J5,IF(BP!S19=32,Cards!J6,0))))))))
The above is a formula right out of my spreadsheet,
It has 8 ifs.
It is working fine.
If I understand you correctly, you are saying this formula should not work.
If so, even though it has been working, am I taking the risk that it might
not always work? (like on a different computer or different conditions during
execution on this same computer.)
Ed

"Arvi Laanemets" wrote:

Hi


"Ed" wrote in message
...
Good , Thanks for the help.
I see that 7 nested does mean 7 ifs plus the original if.


Not so! There can be no more than 7 directly nested if's, which can return 8
different results (a condition of seven filled+no condition filled).

=IF(cond1,resp1,resp2)
=IF(cond1,resp1,IF(cond2,resp2,resp3))
....
=IF(cond1,resp1,IF(cond2,resp2,IF(cond3,resp3,IF(c ond4,resp4,IF(cond5,resp5,
IF(cond6,resp6,IF(cond7,resp7,resp8)))))))

To have more if's in formula you need to 'split' nestings.


Arvi Laanemets



When my 8 ifs did not work and then did work after removing 1 of them, the
problem must have been something else.
Ed

"Niek Otten" wrote:

Hi Ed,

Please post your formula, inputs and result. I bet it isn't 8 *nested*

IFs,
although it may be 8 IFs.
As to your question, I would never count on exceeding Excel's
specifications. Only in this case I don't think they have been exceeded.
In general, Excel will warn you if you try to let it do something can't.

--
Kind regards,

Niek Otten

"Ed" wrote in message
...
Hi
Sometimes when I nest 8 "IF" functions the formula executes properly.
I am wondering, will such a formula always execute properly, or could
different conditions cause it to not execute?

In short, would the following be true?
If a formula works, it will always work so, go ahead and use it.

Thankyou
Ed