# nested if statement w/ a vlookup

#### dazzarello

##### New Member
Hello -
I need some guidance in the build out of an IF(and statement with a vlookup.
I have a workbook where I am pulling in perf ratings based on unique employee id numbers from one tab to another, once I pull the rating it into the 2nd tab, I would like to apply the logic whereby if the referenced cell =2,apply"BTA", if=3, "TGA", if 1, "EXA" and if =4, "URI". Just when I think I got the script, I get a VALUE error. any guidance would be appreciated...

=IF(VLOOKUP(A9,'Data Dump'!A9:Z63,26,FALSE)=1,"EXA"),IF(=2,"BTA"), IF(=3,"TGA"),IF(=4,"URI","")

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

#### Teeroy

##### Well-known Member
Welcome to the forum.

Since you are returning a number the choose function will make it easier for you.

=CHOOSE(VLOOKUP(A9,'Data Dump'!A9:Z63,26,FALSE),"EXA","BTA","TGA","URI")

If you get a #VALUE error with this it means that you didn't get an integer match between 1 & 4 in the VLOOKUP.

#### Marcelo Branco

##### MrExcel MVP
Hi and welcome to Mr Excel Forum

Try (Excel 2007 or higher)

=IFERROR(CHOOSE(VLOOKUP(A9,'DATA DUMP'!A9:Z63,26,FALSE),"EXA","BTA","TGA","URI"),"")

M.

#### BobUmlas

##### Well-known Member
=IFERROR(CHOOSE(VLOOKUP(A9,'Data Dump'!A9:Z63,26,FALSE),"EXA","BTA","TGA","URI"),"")

#### dazzarello

##### New Member
Many many thanks, I was not familiar with the choose function.. so I really don't need to translate the value in column 26 to the abbrev noted above, I can simply order them in chronological order and it works? WHO KNEW..
Many many thanks, it was making me mad

##### MrExcel MVP
Many many thanks, I was not familiar with the choose function.. so I really don't need to translate the value in column 26 to the abbrev noted above, I can simply order them in chronological order and it works? WHO KNEW..
Many many thanks, it was making me mad

It can be also done with what you already know:

Either...

=VLOOKUP(VLOOKUP(A9,'Data Dump'!A9:Z63,26,FALSE),Table,2,FALSE),

where Table consists of numbers and symbols.

Or...

=VLOOKUP(VLOOKUP(A9,'Data Dump'!A9:Z63,26,FALSE),{1,"EXA";2,"BTA";3,"TGA";4,"URI"},2,FALSE)

Replies
3
Views
475
Replies
7
Views
235
Replies
3
Views
337
Replies
13
Views
972
Replies
16
Views
638

1,195,590
Messages
6,010,612
Members
441,558
Latest member
lambierules

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