vlookup with multiple occurances of same value?

muizac

Board Regular
Joined
Oct 24, 2006
Messages
50
Hi there,

I'm struggling to solve this problem. I'd like to list all people with a particular value - when i try a traditional vlookup it only returns the first instance.

My source data is

A........B
55.....John
54.....Peter
55.....Susan
13.....Fred
55.....Paul
53.....Clare
54.....Kevin

In Column C down - I'd like to list of all names with a 55 value. In column D down, a list of everyone with a 54 value etc. Column E = 53 etc

Many thanks
Andrew
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
muizac,


Is this what your raw data looks like, with the results?


Excel Workbook
ABCDEF
1NumberName55545313
255JohnJohnPeterClareFred
354PeterSusanKevin
455SusanPaul
513Fred
655Paul
753Clare
854Kevin
9
Sheet1
 
Upvote 0
That's exactly it mate

This was sample data - the full data list actually has 25 possible values - 55,54,53,52,51,45,44,43,42,41,35,34,33,32,31,25,24,23,22,21,15,14,13,12,11 - so there will be 25 extra columns (column C - Z) to list the names in.

But what you have here is spot on. Is the formula to produce this difficult?

(Hope the snow digging went ok)

Cheers,
Andrew

(Hope

muizac,


Is this what your raw data looks like, with the results?


Excel Workbook
ABCDEF
1NumberName55545313
255JohnJohnPeterClareFred
354PeterSusanKevin**
455SusanPaul***
513Fred****
655Paul****
753Clare****
854Kevin****
9******
Sheet1
 
Upvote 0
muizac,


Excel Workbook
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1NumberName55545352514544434241353433323125242322211514131211
255JohnJohnPeterClareFred
354PeterSusanKevin
455SusanPaul
513Fred
655Paul
753Clare
854Kevin
Sheet1





The formula in cell C2 (confirmed with CTRL + SHIFT + ENTER) not just ENTER, then copied down to the end of your data in column B, then (in this case) copy the range C2:C8 to D2:AA2:

=IF(ISERROR(INDEX($B$2:$B$100,SMALL(IF($A$2:$A$100=C$1,ROW($B$2:$B$100)-ROW($B$2)+1),ROWS($C$2:C2)))),"",INDEX($B$2:$B$100,SMALL(IF($A$2:$A$100=C$1,ROW($B$2:$B$100)-ROW($B$2)+1),ROWS($C$2:C2))))
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,942
Members
449,094
Latest member
teemeren

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