returning multiple results from a vlookup onto single row

ellison

Active Member
Joined
Aug 1, 2012
Messages
343
Office Version
  1. 365
Platform
  1. Windows
Hi,


is there a way to do a vlookup between 2 different lists where the "multiple" hits are returned - rather than only the first one?


(we were using the vlookup, but it only gives us the "first" reference that it looks up)


What we'd like is for the 1st instance to be put in Col B, the second instance in Col C, the 3rd in Col D etc


Just to add to the complications(!), we are trying to do this using a partial lookup eg =vlookup("*"&A1&"*",table array,col_index_sum,FALSE)


EG

List 1Info from Lookup AInfo from Lookup BInfo from Lookup C
postredyellowgreen
gatewhiteblack
List 2
postsred
postedyellow
postgreen
med gatewhite
large gateblack

<tbody>
</tbody>
 
Spreadsheet Formulas
CellFormula
A8=IFERROR(INDEX(INDEX($D$2:$J$4,MATCH($A$7,$A$2:$A$4,0),0),AGGREGATE(15,6,(COLUMN($D$1:$J$1)-COLUMN($D$1)+1)/(INDEX($D$2:$J$4,MATCH($A$7,$A$2:$A$4,0),0)<>0),ROWS($A$14:A14))),"")

<tbody>
</tbody>

<tbody>
</tbody>

So when I took this formula. It works in this scale. If I try to expand it to my full sheet (date columns 90+ and employee rows 180+) I fail miserably. Currently attempting:

=IFERROR(INDEX(INDEX($D$2:$CO$198,MATCH($A$199,$A$2:$A$198,0),0),AGGREGATE(15,6,(COLUMN($D$1:$CO$1)-COLUMN($D$1)+1)/(INDEX($D$2:$CO$198,MATCH($A$199,$A$2:$A$198,0),0)<>0),ROWS($A$207:A207))),"")

which only returns the first instance of a non-zero
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
@ ClerkBot77

Looks like an ISTEXT would be appropriate...

ABCDEFGHIJKL
1NAMETITLEHIRE DATE1/1/20191/2/20191/3/20191/4/20191/5/20191/6/20191/7/2019person b
2PERSON APACKING9/15/2015ALS1400LS1600X
3PERSON BPACKING10/10/20180XLL61LL11000LL61
4PERSON CPACKING11/15/2017A000LS1600LL11
5

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

In L2 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($D$2:$J$4,MATCH(L$1,$A$2:$A$4,0),SMALL(IF(ISTEXT(INDEX($D$2:$J$4,MATCH(L$1,$A$2:$A$4,0),0)),COLUMN($D$2:$J$4)-COLUMN($D$2)+1),ROWS(L$2:L2))),"")


This doesn't return any results.
 
Upvote 0
This doesn't return any results.

there was a any typo, I didn't analyse it because Excel corrected it for me :)

try
Code:
=IFERROR(INDEX($D$2:$J$4,MATCH(L$1,$A$2:$A$4,0),SMALL(IF(ISTEXT(INDEX($D$2:$J$4,MATCH(L$1,$A$2:$A$4,0),0)),COLUMN($D$2:$J$4)-COLUMN($D$2)+1),ROWS(L$2:L2))),"")
with CSE

L
M
N
1
Person APerson BPerson C
2
AXA
3
LS14LL61LS16
4
LS16LL11
5

Add headers manually
Formula (in this case) in L2 Control+Shift+Enter drag to the right then down
 
Last edited:
Upvote 0
This doesn't return any results.

Column L of the Excel readable visual shows the results that the suggested formula delivers. Did you apply control+shift+enter as requested?

Control+shift+enter: Press down the control and the shift keys at the same time while you hit the enter key. When done successfully, Excel itself puts a pair of { and } around the formula in recognition.
 
Upvote 0
there was a any typo, I didn't analyse it because Excel corrected it for me :)

try
Code:
=IFERROR(INDEX($D$2:$J$4,MATCH(L$1,$A$2:$A$4,0),SMALL(IF(ISTEXT(INDEX($D$2:$J$4,MATCH(L$1,$A$2:$A$4,0),0)),COLUMN($D$2:$J$4)-COLUMN($D$2)+1),ROWS(L$2:L2))),"")
with CSE

[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]L[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]M[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]N[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]1[/COLOR]​
Person APerson BPerson C
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]2[/COLOR]​
AXA
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]3[/COLOR]​
LS14LL61LS16
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]4[/COLOR]​
LS16LL11
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]5[/COLOR]​

<tbody>
</tbody>


Add headers manually
Formula (in this case) in L2 Control+Shift+Enter drag to the right then down




Thank you, this is working out.

Is there a good way to also capture the date in a separate column?
 
Upvote 0

Forum statistics

Threads
1,216,558
Messages
6,131,400
Members
449,648
Latest member
kyouryo

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