more than 7 "if statements" at once

  • Thread starter Thread starter westy
  • Start date Start date
W

westy

ok..I have used the "IF " function...I can get it to
work for 7 items...how do i add another 7? or can I ?I
have this =IF(E4="NE","7",IF(E4="PIT","7",IF
(E4="TEN","7",IF(E4="IND","7",IF(E4="KC","7",IF
(E4="TB","7",IF(E4="MIN","7","0")))))))...works
fine...can I add 7 more?
 
You cannot nest more than 7 function calls of any kind. Your
application is ideal for setting up a separate table and using VLOOKUP
instead of nested IFs.

Jerry
 
try using
=vlookup(e4,{"ne","pit",etc},{1,2,3})
OR
if indeed all resolve to 7 then
=if(e4=or("ne","pit",etc),7,0)
 
ok..I have used the "IF " function...I can get it to
work for 7 items...how do i add another 7? or can I ?I
have this =IF(E4="NE","7",IF(E4="PIT","7",IF
(E4="TEN","7",IF(E4="IND","7",IF(E4="KC","7",IF
(E4="TB","7",IF(E4="MIN","7","0")))))))...works
fine...can I add 7 more?

You can't nest more than seven functions. However, your formula is equivalent
to:

=IF(ISNA(MATCH(E4,{"NE","PIT","TEN","IND","KC","TB","MIN"},0)),0,7)

and you can add as many strings as you wish to the array constant.

If you need a different result than 7 for a match, and 0 for no match, then
VLOOKUP might be a better choice.


--ron
 
Back
Top