Using drop down list to get information about the selected

Powerdog

Board Regular
Joined
Oct 6, 2004
Messages
50
I'm trying to learn how to use a drop down list (B3 on sheet2) to get that person's information (hours and rate) from (E3 and G3) sheet1 to show up at E3 and G3 on sheet2 with that person's name in the list box.
Column A on sheet1 is "Defined" as nursesname.
I got some great help yesterday... but I still can't get a grip on how it's done. I keep getting errors...
I created this smaller example so I could understand easier how to link it all together.
I really do appreciate the patience and help.
Book1.xls
ABCDE
1NursesRateHours
2
3Barbara1033
4Dawn1542
5James3215
6Shelly951
Sheet1
Book1.xls
ABCDEFG
1
2NurseRateHours
3
Sheet2
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Re: Using drop down list to get information about the select

What kind of errors are you getting?

texasalynn
 
Upvote 0
Re: Using drop down list to get information about the select

How about VLOOKUP:
Book2
ABCDE
1NursesRateHours
2
3Barbara1033
4Dawn1542
5James3215
6Shelly951
Sheet2


Hope that helps,

Smitty
 
Upvote 0
Edit: Apparently everyone posted while I was typing this, but I'm going to post it anyway. It took me long enough ;)

Ok, using your examples above:

In Sheet1, you set the nurses' names as a named range, then set column B on Sheet2 to a data validation list using that named range. I think you've already got that part down, if I remember correctly. While we're at it though, delete the blank columns inbetween the columns of data on Sheet1. It looks nice, but it won't help you in the long run. After that, go ahead and select the entire table and name the range 'data' or whatever you want.

Now we're only going to work with Sheet2. To pull the rates and hours for the selected nurses, you use the VLOOKUP statements.

In E3, enter the following formula:
=IF($B3="","",VLOOKUP($B3,data,2,0))

B3 = the name you want to lookup in the table
data = the named range of the table from Sheet1
2 = the column number from the table you want to return information for the selected name (on Sheet1, Nurses is your first column, Rate your second, and so on).

You can simply copy the formula over to the Hours column, EXCEPT: in the formula, change the 2 to a 3, so it will look up information from the Hours column in the table.
After that, you should be able to simply select those cells and fill the formula down the column; the row references will change where needed.

Or, What this formula says in English:
"If there is no nurse selected in column B for this row, don't show anything in this cell. Otherwise, lookup the name selected in B3 in the table from Sheet1 and put the data from the second column in the table for this record here."
 
Upvote 0
Re: Using drop down list to get information about the select

Thanks for the replies...
I tried that one and I get #N/A for an error.
On sheet2 right below the title "nurse" is a drop down list (B3) with all the names of the nurses from Column A on sheet1.
What I'm trying to learn is to use that drop down list (on sheet2) to pick one of the nurses, then I'll get they're hours and rate to show on sheet2 E3 and G3.
 
Upvote 0
Are you getting the #N/A errors before you select a name from the list? If so, that's because the formula isn't seeing anything in the specified to lookup and can't return a value. So it's showing an error.

Example:
Book1
ABCD
1NursesRateHours
2#N/A#N/A(FormulaswithoutIFstatement)
3  (formulaswithIFstatement)
Sheet2


Edit: Formulas located in:

B1: =VLOOKUP($A2,data,2,0)
C1: =VLOOKUP($A2,data,3,0)
B3: =IF($A3="","",VLOOKUP($A3,data,2,0))
D3: =IF($A3="","",VLOOKUP($A3,data,3,0))
 
Upvote 0
Re: Using drop down list to get information about the select

Thank You Very Much Von Pookie...
Thats exactly what I was looking for in ELEMENTARY!!!!!
Thanks a BILLION!!!!!
 
Upvote 0
Re: Using drop down list to get information about the select

I highlited the area for the "data" range.... and "defined" that has "data"... but what happens down the road when I add more nurses (I have the "nursename" range long enough not to worry about that range, but what about the "data" range... will I have to keep going back and highlite the whole area again... or did you mean the whole table as in the whole sheet?
and if thats the case... ?????
 
Upvote 0
"Whole table" meant just the data, actually. I'm assuming setting it as a dynamic named range instead would work? I haven't tried that before myself, so I can't give you an example right off the bat.

I know it's been done here on the board quite a bit, though. Maybe a search would turn something up on that?
 
Upvote 0

Forum statistics

Threads
1,222,695
Messages
6,167,691
Members
452,131
Latest member
MichelleH77

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