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

Ed wrote...
=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,Cards!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.

....

The formula above has only 7 levels of nested function calls, so it
should always work in any version of Excel that can run on Win32
systems. That said, it could be shortened to

=IF(BP!S19=25,Cards!D25,
IF(BP!S19=26,Cards!D26,
IF(OR(BP!S19={27,28,29,30,31,32}),INDEX(Cards!J1:J 6,BP!S19-26),0))))))))