Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Too many arguments for nested IFs

Ive created a nested IF statement that works fine using 6 IFs but does not
work when I add a 7th, the maximum number allowed. However, I ultimately
need 10. Does someone know of an alternative way of doing this? The formula
looks like this:

=IF(AND(LEFT(A2,2)="10",NOT(C2="MP")),"Change Sector to
MP",IF(AND(LEFT(A2,2)="20",NOT(C2="BV")),"Change Sector to
BV",IF(AND(LEFT(A2,2)="30",NOT(C2="HH")),"Change Sector to
HH",IF(AND(LEFT(A2,2)="40",NOT(C2="AP")),"Change Sector to
AP",IF(AND(LEFT(A2,2)="50",NOT(C2="CM")),"Change Sector to
CM",IF(AND(LEFT(A2,2)="60",NOT(C2="RS")),"Change Sector to RS",""))))))

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Too many arguments for nested IFs

Check out this link...

http://www.cpearson.com/excel/nested.htm
--
HTH...

Jim Thomlinson


"Marie FP" wrote:

Ive created a nested IF statement that works fine using 6 IFs but does not
work when I add a 7th, the maximum number allowed. However, I ultimately
need 10. Does someone know of an alternative way of doing this? The formula
looks like this:

=IF(AND(LEFT(A2,2)="10",NOT(C2="MP")),"Change Sector to
MP",IF(AND(LEFT(A2,2)="20",NOT(C2="BV")),"Change Sector to
BV",IF(AND(LEFT(A2,2)="30",NOT(C2="HH")),"Change Sector to
HH",IF(AND(LEFT(A2,2)="40",NOT(C2="AP")),"Change Sector to
AP",IF(AND(LEFT(A2,2)="50",NOT(C2="CM")),"Change Sector to
CM",IF(AND(LEFT(A2,2)="60",NOT(C2="RS")),"Change Sector to RS",""))))))

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Too many arguments for nested IFs

Maybe something like this:

Create a 2 column table like this:

10MP...MP
20BV...BV
30HH...HH
40AP...AP
50CM...CM
60RS...RS

Assume this table is in the range F1:G6

Then use this formula:

=IF(OR(A2="",COUNT(MATCH(LEFT(A2,2)&C2,F1:F6,0))), "","Change Sector To
"&INDEX(G1:G6,MATCH(LEFT(A2,2)&"*",F1:F6,0)))


--
Biff
Microsoft Excel MVP


"Marie FP" <Marie wrote in message
...
I've created a nested IF statement that works fine using 6 IFs but does
not
work when I add a 7th, the maximum number allowed. However, I ultimately
need 10. Does someone know of an alternative way of doing this? The
formula
looks like this:

=IF(AND(LEFT(A2,2)="10",NOT(C2="MP")),"Change Sector to
MP",IF(AND(LEFT(A2,2)="20",NOT(C2="BV")),"Change Sector to
BV",IF(AND(LEFT(A2,2)="30",NOT(C2="HH")),"Change Sector to
HH",IF(AND(LEFT(A2,2)="40",NOT(C2="AP")),"Change Sector to
AP",IF(AND(LEFT(A2,2)="50",NOT(C2="CM")),"Change Sector to
CM",IF(AND(LEFT(A2,2)="60",NOT(C2="RS")),"Change Sector to RS",""))))))



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Too many arguments for nested IFs

Ooops!

Disregard that formula. I tested using only numbers in cell A2.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Maybe something like this:

Create a 2 column table like this:

10MP...MP
20BV...BV
30HH...HH
40AP...AP
50CM...CM
60RS...RS

Assume this table is in the range F1:G6

Then use this formula:

=IF(OR(A2="",COUNT(MATCH(LEFT(A2,2)&C2,F1:F6,0))), "","Change Sector To
"&INDEX(G1:G6,MATCH(LEFT(A2,2)&"*",F1:F6,0)))


--
Biff
Microsoft Excel MVP


"Marie FP" <Marie wrote in message
...
I've created a nested IF statement that works fine using 6 IFs but does
not
work when I add a 7th, the maximum number allowed. However, I ultimately
need 10. Does someone know of an alternative way of doing this? The
formula
looks like this:

=IF(AND(LEFT(A2,2)="10",NOT(C2="MP")),"Change Sector to
MP",IF(AND(LEFT(A2,2)="20",NOT(C2="BV")),"Change Sector to
BV",IF(AND(LEFT(A2,2)="30",NOT(C2="HH")),"Change Sector to
HH",IF(AND(LEFT(A2,2)="40",NOT(C2="AP")),"Change Sector to
AP",IF(AND(LEFT(A2,2)="50",NOT(C2="CM")),"Change Sector to
CM",IF(AND(LEFT(A2,2)="60",NOT(C2="RS")),"Change Sector to RS",""))))))





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Too many arguments for nested IFs

Assuming that cell A2 will *only* contain entries that start with 10, 20,
30, 40, 50 or 60:

2 column lookup table in the range F1:G6

10...MP
20...BV
30...HH
40...AP
50...CM
60...RS

Then:

=IF(A2="","",IF(C2=VLOOKUP(--LEFT(A2,2),F1:G6,2,0),"","Change Sector To
"&VLOOKUP(--LEFT(A2,2),F1:G6,2,0)))

If that doesn't work then you'll need to tell us exactly what the possible
entries are for cell A2.


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Ooops!

Disregard that formula. I tested using only numbers in cell A2.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Maybe something like this:

Create a 2 column table like this:

10MP...MP
20BV...BV
30HH...HH
40AP...AP
50CM...CM
60RS...RS

Assume this table is in the range F1:G6

Then use this formula:

=IF(OR(A2="",COUNT(MATCH(LEFT(A2,2)&C2,F1:F6,0))), "","Change Sector To
"&INDEX(G1:G6,MATCH(LEFT(A2,2)&"*",F1:F6,0)))


--
Biff
Microsoft Excel MVP


"Marie FP" <Marie wrote in message
...
I've created a nested IF statement that works fine using 6 IFs but does
not
work when I add a 7th, the maximum number allowed. However, I
ultimately
need 10. Does someone know of an alternative way of doing this? The
formula
looks like this:

=IF(AND(LEFT(A2,2)="10",NOT(C2="MP")),"Change Sector to
MP",IF(AND(LEFT(A2,2)="20",NOT(C2="BV")),"Change Sector to
BV",IF(AND(LEFT(A2,2)="30",NOT(C2="HH")),"Change Sector to
HH",IF(AND(LEFT(A2,2)="40",NOT(C2="AP")),"Change Sector to
AP",IF(AND(LEFT(A2,2)="50",NOT(C2="CM")),"Change Sector to
CM",IF(AND(LEFT(A2,2)="60",NOT(C2="RS")),"Change Sector to RS",""))))))







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
nested if still has too many arguments Janis Excel Discussion (Misc queries) 4 September 5th 07 06:02 PM
3 level nested if has too many arguments ? Janis Excel Discussion (Misc queries) 4 September 5th 07 04:59 PM
Nested IF's with Logical Arguments - Doing something wrong her ConfusedNHouston Excel Discussion (Misc queries) 0 November 30th 06 04:36 PM
Nested IF's with Logical Arguments - Doing something wrong here Dave F Excel Discussion (Misc queries) 0 November 30th 06 04:03 PM
I have run out of arguments for nested IF statement christopherp Excel Discussion (Misc queries) 5 March 19th 06 12:26 PM


All times are GMT +1. The time now is 11:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"