Need Vlookup function to pick up more than one record

ellac

New Member
Joined
Oct 4, 2004
Messages
37
I have a vlookup function in a pivot table looking up a specific value in another sheet, the problem is that it is only looking up one value and there is more than one record found for that vlookup.

Is there a way to list all the records pertaining to that vlookup value.

I hope this makes sense.

Thanks in advance.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi,

You could try this.

The formula needs to be entered with Ctrl + Shift + enter in D2 before dragged down.

When you adjust the ranges to fit your layout; note that the range for the Index function always must start at row one wherever your data is.
Book3
ABCD
1
2PJ1PJ1
3Ken24
4Mike310
5PJ4#NUM!
6Ken5
7Larry6
8Larry7
9Joe8
10Bob9
11PJ10
Sheet1
 
Upvote 0
What I suggested was a formula.

If your data was like in the exibit above it would look like:

=INDEX($B$1:$B$11,SMALL(IF($A$2:$A$11=$C$2,ROW($A$2:$A$11)),ROW()-ROW($D$1)))

Obviously it does not but as you have not specified your ranges you need to adjust the formula yourself.

Remember:

The formula needs to be entered with Ctrl + Shift + enter in D2 before dragged down.

When you adjust the ranges to fit your layout; note that the range for the Index function always must start at row one wherever your data is.
 
Upvote 0
It does not seem to do what I need. Maybe I did not explain it properly.

Sheet 1 has a value that I am looking up on sheet 2. The problem is that the value I am looking up ie. 542A has three records affiliated with it ie. jane, Ann and Joe.

I want the function to bring all three back into my first sheet and list it down the column. As of now I am using a vlookup that just brings back Jane and if I copy it down it just lists Jane not Ann and Joe.

I hope this makes sense, I may not be able to do it with a Vlookup.

Thanks again for all you help
 
Upvote 0
Please look closer at what I have posted. As I understand it does exactly what you ask for.
 
Upvote 0
Still not working for me. Everytime I specify a different worksheet I receive the error #NA.

I don't know what I am doing wrong.

Thanks
 
Upvote 0
Correction the error I receive is #num.

Is it because the data is on a separate worksheet, not on the same one as your example?
 
Upvote 0
It would be so much easier if you could specify your ranges and I could type out the formula for you.

That it is a different sheet should not matter. But if you forget to confirm the formula with Ctrl + shift + enter instead of just enter it will not work.

Here I replace the ranges with al etter to explain what I mean:

=INDEX(A,SMALL(IF(B=C,ROW(B)),ROW()-ROW(D)))

A -- is the column with the values you want the formula to return This range must always start in row one even if your data starts lower.

B -- is the column to search for the lookup values

C -- is the one cell with the lookup value

D -- is a cell one row above wher you place the first formula (it does not matter what is in that cell)


It is important that you make all references absolute e.g. $C$2

If you cannot get this to work you need to post your sheet or clearly describe your layout.
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,290
Members
449,149
Latest member
mwdbActuary

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