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

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
Joined
Nov 9, 2012
Messages
2,244
Office Version
  1. 365
Platform
  1. Windows
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

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,100
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
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

dazzarello

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

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
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,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.
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