VLOOKUP based on drop down list

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
Hi,
I need to select a value from my drop down list and the code will look at three values in a database then put them in three next to where the drop down list is.
Here is the info for you.

Worksheet is called TEST
Drop down list is in column B
Cells awaiting data are in column C, D, E
Table database is on same worksheet & range is N4:Q21
Find name in column N
First value to look at is in column O
Second value to look at is in column P
Third column value to look at is in column Q

So It would work like this,
Cell B5 select name from drop down list.
Look for that name in column N of table database.
Once found get value from column O,P & Q
Then put that value in Row 5 column C,D & E
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
[table="class:thin_grid"]
[tr][td]v[/td]
[td="bgcolor:#ECF0F0, align:center"]C[/td]
[td="bgcolor:#ECF0F0, align:center"]D[/td]
[td="bgcolor:#ECF0F0, align:center"]E[/td]
[/tr][tr][td="bgcolor:#ECF0F0, align:center"]1[/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[/tr]
[tr][td="bgcolor:#ECF0F0, align:center"]2[/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[/tr]
[tr][td="bgcolor:#ECF0F0, align:center"]3[/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[/tr]
[tr][td="bgcolor:#ECF0F0, align:center"]4[/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[td="bgcolor:#FFFFFF, align:CENTER"][/td]
[/tr]
[tr][td="bgcolor:#ECF0F0, align:center"]5[/td]
[td="bgcolor:#FFFFFF, align:CENTER"]=VLOOKUP($B$5,$N$4:$Q$21,2,0)[/td]
[td="bgcolor:#FFFFFF, align:CENTER"]=VLOOKUP($B$5,$N$4:$Q$21,3,0)[/td]
[td="bgcolor:#FFFFFF, align:CENTER"]=VLOOKUP($B$5,$N$4:$Q$21,4,0)[/td]
[/tr]
[/table]
 
Upvote 0
Hi,
Yes that works.

Before i select from the drop down list colmns C,D & E show #N/A until i make a drop down selection.
Need to be able to show the cell is blank without the #N/A

Im not sure the correct way to write it but did the following & now i see #NA ME?

Code:
=IFERROR(VLOOKUP($B$5,$N$4:$Q$21,3,FALSE),””)
 
Upvote 0
Hi,
This gives me a blank cell but is it correct & ok to use ?

Code:
=IFERROR(VLOOKUP(B5,$N$4:$Q$21,2,0),"")
 
Upvote 0
If it works, then why wouldn't it be ok. Afterall, it is your spreadsheet and you are the one that needs to be happy.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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