Can you have to many arguements in a formula

  • Thread starter Thread starter CeeCee
  • Start date Start date
C

CeeCee

I am atempting to add another arguement to an IF statement. I already have
eight and when I enter the additional statement I get an error

=IF(Q2=351,"Diesel",(IF(Q2=205,"Outside Svcs",(IF(q2=450,"Equip
Rntl",(IF(Q2=540,"Trans",(IF(Q2=541,"Air
Trans",(IF(Q2=542,"Motel",(IF(Q2=543,"Meals",(IF(Q2=206,"Supply",(IF(Q2=520,"Whse Rntl","Gas")))))))))))))))))

I use this every week and may need to add more. I apply this formula to
over 2,000 rows of information.

Help !!!
 
CeeCee said:
I am atempting to add another arguement to an IF statement. I already have
eight and when I enter the additional statement I get an error

=IF(Q2=351,"Diesel",(IF(Q2=205,"Outside Svcs",(IF(q2=450,"Equip
Rntl",(IF(Q2=540,"Trans",(IF(Q2=541,"Air
Trans",(IF(Q2=542,"Motel",(IF(Q2=543,"Meals",(IF(Q2=206,"Supply",(IF(Q2=520,"Whse Rntl","Gas")))))))))))))))))

I use this every week and may need to add more. I apply this formula to
over 2,000 rows of information.

Help !!!


Take a look at this:

http://www.contextures.com/xlFunctions02.html
 
CeeCee said:
I am atempting to add another arguement to an IF statement. I already have
eight and when I enter the additional statement I get an error

=IF(Q2=351,"Diesel",(IF(Q2=205,"Outside Svcs",(IF(q2=450,"Equip
Rntl",(IF(Q2=540,"Trans",(IF(Q2=541,"Air
Trans",(IF(Q2=542,"Motel",(IF(Q2=543,"Meals",(IF(Q2=206,"Supply",(IF(Q2=520,"Whse Rntl","Gas")))))))))))))))))

I use this every week and may need to add more. I apply this formula to
over 2,000 rows of information.

Help !!!


To answer the question in your Subject, this is from the help file under "IF
worksheet function":

Up to seven IF functions can be nested as value_if_true and value_if_false
arguments to construct more elaborate tests.
 
=IF(ISNA(VLOOKUP(Q2,{351,205,450,540,541,542,543,206,520;"Diesel","Outside
Svcs","Equip Rntl","Trans","Air Trans","Motel","Meals","Supply","Whse
Rntl"},2,FALSE)),"Gas",VLOOKUP(Q2,{351,205,450,540,541,542,543,206,520;"Diesel","Outside
Svcs","Equip Rntl","Trans","Air Trans","Motel","Meals","Supply","Whse
Rntl"},2,FALSE))

Works!
 
Back
Top