Return Multiple Results of Vlookup Value

jopstam

New Member
Joined
Aug 12, 2010
Messages
5
i would like to know how to display multiple result for the lookup value.
If i lookup for AAA & ask for the return value of location, how to get all 3 results (R1,R3 & R4)

item# Location
AAA R1
BBB R2
AAA R3
AAA R4
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Here is the set up (formulas in green cells):
Excel Workbook
ABCDE
1AAAR1ItemCount
2BBBR2AAA3
3AAAR3
4AAAR4Return items
5R1
6R3
7R4
8.
9.
10.
11.
...


Enter this formula in cell E2:

=COUNTIF(A1:A4,D2)

Enter this formula in cell E5 with Ctrl + Shift + Enter (not just Enter) and copy down:

=IF(ROWS(E$5:E5)>$E$2,"",INDEX($B$1:$B$4,SMALL(IF($A$1:$A$4=$D$2,ROW($B$1:$B$4)-ROW($B$1)+1),ROWS(E$5:E5))))



Or to get a horizontal orientation:
Excel Workbook
ABCDEFG
1AAAR1ItemCount
2BBBR2AAA3
3AAAR3
4AAAR4
5
6Returned ItemsR1R3R4...
...


Enter this formula in cell E2:

=COUNTIF(A1:A4,D2)

Enter this formula in cell B6 with Ctrl + Shift + Enter (not just Enter) and to the side:

=IF(COLUMNS($I13:I13)>$E$2,"",INDEX($B$1:$B$4,SMALL(IF($A$1:$A$4=$D$2,ROW($B$1:$B$4)-ROW($B$1)+1),COLUMNS($I13:I13))))
 
Last edited:
Upvote 0
If you have Excel 2010, this non-array formula (Does Not Need Ctrl + Shift + Enter) may work for you:
Excel Workbook
ABCDEFG
1AAAR1ItemCount
2BBBR2AAA3
3AAAR3
4AAAR4
5
6Returned ItemsR1R3R4...
7
8Return items
9R1
10R3
11R4
12.
13.
14.
15.
...


In cell E2:

=COUNTIF(A1:A4,D2)

In cell B6, then copy to the side:

=IF(COLUMNS($E9:E9)>$E$2,"",INDEX($B$1:$B$4,AGGREGATE(15,6,(ROW($B$1:$B$4)-ROW($B$1)+1)/($A$1:$A$4=$D$2),COLUMNS($E9:E9))))

In E9, then copy down:

=IF(ROWS(E$9:E9)>$E$2,"",INDEX($B$1:$B$4,AGGREGATE(15,6,(ROW($B$1:$B$4)-ROW($B$1)+1)/($A$1:$A$4=$D$2),ROWS(E$9:E9))))
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,777
Members
449,049
Latest member
greyangel23

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