VLOOKUP-How to Select One of Many Names

kstvns

New Member
Joined
Feb 27, 2011
Messages
20
Using Excel 2003 with Win XP.

I am creating a timesheet. On a separate worksheet, I have three columns named LastName, FirstName, Section. On another worksheet, I inserted a formula in B1 that, based on the entry of the last ame, the first name and section will appear in cells B2 and B3, respectively. The problem is that more than one person has the same last name (e.g., Smith.)

If John Smith enters his last name, what can I do to make it not show Will Smith?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Using Excel 2003 with Win XP.

I am creating a timesheet. On a separate worksheet, I have three columns named LastName, FirstName, Section. On another worksheet, I inserted a formula in B1 that, based on the entry of the last ame, the first name and section will appear in cells B2 and B3, respectively. The problem is that more than one person has the same last name (e.g., Smith.)

If John Smith enters his last name, what can I do to make it not show Will Smith?
You need to come up with some method of making the names unique.

On your master sheet enter the names something like this:

Smith(J), John
Smith(W), Will

Then, you'd look for Smith(J) or Smith(W).

If they both also happen to have the same first name then you can give them unique numbers like:

Smith(1), John
Smith(2), John
 
Upvote 0
Enter in C1

=COUNTIF(LastName,B1)

A2, control+shift+enter, not just enter, copy down...

=IF(ROWS(B$2:B2)<=$C$1,SMALL(IF(LastName=$B$1,ROW(LastName)-MIN(ROW(LastName))+1),ROWS(B$2:B2)),"")

B2, copy down...

=IF(N($A2),INDEX(LastName,$A2),"")

Change LastName to the actual reference & for the Section.
 
Upvote 0
Haseeb,

Column A already has data in it. A1 is Last Name; A2 is First Name; A3 is Section; and A4 is Month. As a result, B1:B3 is where the information for A1:A3 will be placed/entered.

What modification to the formula do I need to make? :confused:
 
Upvote 0
I provided wrong information in my first post.

Using Excel 2003 with Win XP.

I am creating a timesheet. On a separate worksheet, I have three columns named LastName, FirstName, Section. On the timesheet, A1 is labeled Last Name; A2 is labeled First Name; A3 is labeled Section. I inserted a formula in B1 that, based on the entry of the last name, the first name and section will appear in cells B2 and B3, respectively. The problem is that more than one person has the same last name (e.g., Smith.)

If John Smith enters his last name, what can I do to make it not show Will Smith?
 
Upvote 0

Forum statistics

Threads
1,214,667
Messages
6,120,822
Members
448,990
Latest member
rohitsomani

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