efficient way to lookup and return multiple values?

daveyc18

Well-known Member
Joined
Feb 11, 2013
Messages
707
Office Version
  1. 365
  2. 2010
currently i i want to look up a unique security ID to another tab and return the inventories its in.

the problem with obviously vlookup is that it would only return the first inventor result found.....what would be a way to return all the inventories the security ID is in? i suppose this can't be done in one shot.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
post an example of source data and expected result (in table form)
 
Upvote 0
post an example of source data and expected result (in table form)

=VLOOKUP(E15,'DTR Pivot'!A:B,2,0)

where e15 has the security ID

in the DTR Pivot tab, column A has the security ID, but column B has the inventory number.....but as i said, in the pivot, the security ID can have multiple inventory numbers and vlooup would only return the first result in column B
 
Upvote 0
Assume, your E15 was the first of security ID, and E16 was its second, and further E17 was its third, etc..., try:

F15=INDEX('DTR Pivot'!$B$1:$B$2000,MATCH(E15,'DTR Pivot'!$A$1:$A$2000,)-1+COUNTIF($E$1:E15,E15))
(Enter only)

Hope correct!
 
Upvote 0
Sounds like an ideal job for a query. Works like a database query.
Simpler but may not perfectly suit what you want is a pivot table.
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,109
Members
448,548
Latest member
harryls

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