nested if statement w/ a vlookup

dazzarello

New Member
Joined
Jan 13, 2014
Messages
2
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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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.
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,625
Messages
6,120,598
Members
448,973
Latest member
ksonnia

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
Back
Top