# three nested If statements

#### DNapoli

##### New Member
Can someone help me get this to work. Currently becasue I added the last if statement it does not work.

Thanks!
Danielle

=IF(G2="FDIC","FDIC",IF(ISNUMBER(SEARCH("*GSK*",H2)),"GSK",M2)), IF(ISNUMBER(SEARCH("*DCM*",J2)),"DCM",M2)

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

#### DNapoli

##### New Member
I actually got it to work my Self ..Yea for me!!

=IF(G223="FDIC","FDIC",IF(ISNUMBER(SEARCH("*GSK*",H223)),"GSK",IF(ISNUMBER(SEARCH("*DCM*",J223)),"DCM",M223)))

#### Soggy

##### Board Regular
You need to tell us what you are trying to do.

This won't work as the first if statement leads to the next if statement if it is false and post FDIC if true.

The second if statement will get the value from M2 if false and post GSK if true.

The third if statement is not nested in either so is creating an error.

If you want it to go to third if statement on a false result then hopefully this will work

=IF(G2="FDIC","FDIC",IF(ISNUMBER(SEARCH("*GSK*",H2)),"GSK",IF(ISNUMBER(SEARCH("*DCM*",J2)),"DCM",M2)))

All you needed was to replace the M2 in you second statement wiht the third if statement and add the brackets on.

If you were after something else let us know.

Don't think I have ever typed statement so much in my life.

Replies
3
Views
268
Replies
5
Views
108
Replies
3
Views
105
Replies
5
Views
163
Replies
3
Views
193

1,130,051
Messages
5,639,773
Members
417,112
Latest member
PachRedoc

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