nested if formula

Cossie

Active Member
Joined
May 6, 2002
Messages
327
Hello everyone I need some assistance with a nested if statement.

My formula looks like this but it has an error.

=IF(A2="n",IF(B2="under 12 months",0,IF(A2="Y",IF(B2="under 12 months",0,IF(A2="n",IF(B2="12-24 months",750,IF(A2="y",IF(B2="12 -24 months",1100,IF(A2="N",IF(B2="24 -36 months",1500,IF(A2="y",IF(B2="24 - 36 months",1500,IF(A2="n",IF(B2="36 months plus",2000,IF(A2="y",B2="36 months plus",2000))))))))))))))).

Any ideas for a better formula
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi, Cossie,

you cannot nest more then 7 IFs
you can put in a little table what the options + outcome are: so someone can see what you want to do (I can imagine)
seems like you could use some Vlookup-formula
so take a look in the helpfiles for Vlookup (perhaps Index & Match)

kind regards,
Erik
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Perhaps use a table like this
Book1
ABCDEFGH
1YN
2N12-24 months750Under 12 months00
312-24 months1100750
424-36 months15001500
536 months plus20002000
6
Sheet4


Formula in C2

=INDEX(F$2:G$5,MATCH(A2,F$1:G$1,0),MATCH(B2,E$2:E$5,0))

or if you want to do it without a table then try this formula

=INDEX({0,0;1100,750;1500,1500;2000,2000},MATCH(A2,{"Y","N"},0),MATCH(B2,{"Under 12 months","12-24 months","24-36 months","36 months plus"},0))
 

Forum statistics

Threads
1,170,932
Messages
5,872,779
Members
432,945
Latest member
eddyevad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top