# nested if formula

#### Cossie

##### Active Member
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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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

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))

Replies
2
Views
514
Replies
9
Views
818
Replies
3
Views
100
Replies
1
Views
209
Replies
2
Views
166

1,219,672
Messages
6,149,616
Members
450,904
Latest member
Gracifer

### 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.

### Which adblocker are you using?

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

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