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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

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