VLOOKUP And Return Multiple Corresponding Values

BORUCH

Well-known Member
Joined
Mar 1, 2016
Messages
548
Office Version
  1. 365
Platform
  1. Windows
HI

I have a table that looks as follows

[TABLE="width: 500"]
<tbody>[TR]
[TD]customer # and invoice number[/TD]
[TD]note 1[/TD]
[TD]note 2[/TD]
[/TR]
[TR]
[TD]AA~123[/TD]
[TD]SAMPLE 1[/TD]
[TD]SAMPLE 2[/TD]
[/TR]
[TR]
[TD]AA~456[/TD]
[TD]SAMPLE 3[/TD]
[TD]SAMPLE 4[/TD]
[/TR]
[TR]
[TD]AA TOTAL[/TD]
[TD]SAMPLE 5[/TD]
[TD]SAMPLE 6[/TD]
[/TR]
[TR]
[TD]BB~789[/TD]
[TD]SAMPLE 7[/TD]
[TD]SAMPLE 8[/TD]
[/TR]
[TR]
[TD]BB~111[/TD]
[TD]SAMPLE 9[/TD]
[TD]SAMPLE 10[/TD]
[/TR]
[TR]
[TD]BB TOTAL[/TD]
[TD]SAMPLE 11[/TD]
[TD]SAMPLE 12[/TD]
[/TR]
</tbody>[/TABLE]

my goal is to put in a customer # in cell F5 (AA OR BB )

And return underneath all his invoices, and then I can do a VLOOKUP On all the invoice numbers and return the corresponding note

How can i accomplish that

the invoice numbers wouldbe the numbers after the ~

Any help is greatly appreciated

thanks
<o:p></o:p>

 
Last edited:

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.
Re: How To VLOOKUP And Return Multiple Corresponding Values

Hi,

There are several possible solutions ...:wink:

The quick one is to use from the Menu Advanced Filter ...

HTH
 
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values

Hi,

There are several possible solutions ...:wink:

The quick one is to use from the Menu Advanced Filter ...

HTH


I'm looking for a formula
 
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values

Any updates
 
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values


Book1
ABCDEFGH
1customer # and invoice numbernote 1note 2AAnote 1note 2
2AA~123SAMPLE 1SAMPLE 2AA~123SAMPLE 1SAMPLE 2
3AA~456SAMPLE 3SAMPLE 4AA~456SAMPLE 3SAMPLE 4
4AA TOTALSAMPLE 5SAMPLE 6
5BB~789SAMPLE 7SAMPLE 8
6BB~111SAMPLE 9SAMPLE 10
7BB TOTALSAMPLE 11SAMPLE 12
Sheet1


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

=IFERROR(INDEX($A$2:$A$7,SMALL(IF(ISNUMBER(RIGHT($A$2:$A$7)+0),IF(ISNUMBER(SEARCH("|"&$F$1,"|"&$A$2:$A$7)),ROW($A$2:$A$7)-ROW(INDEX($A$2:$A$7,1,1))+1)),ROWS($F$2:F2))),"")

In G2 just enter, copy across, and down:

IF($F2="","",INDEX($A$2:$C$7,MATCH(SUBSTITUTE($F2,"~","~~"),$A$2:$A$7,0),MATCH(G$1,$A$1:$C$1,0)))
 
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values

hi

i just realized a little issue with my data set i can have the column as follows

[TABLE="width: 500"]
<tbody>[TR]
[TD]AA123~~
[/TD]
[/TR]
[TR]
[TD]AA123~845612~[/TD]
[/TR]
[TR]
[TD]AA123 TOTAL[/TD]
[/TR]
[TR]
[TD]BB123~~[/TD]
[/TR]
[TR]
[TD]BB123~845613~[/TD]
[/TR]
[TR]
[TD]BB123~X45665~[/TD]
[/TR]
[TR]
[TD]BB123~h12541~[/TD]
[/TR]
[TR]
[TD]BB123 TOTAL[/TD]
[/TR]
[TR]
[TD]ETC....[/TD]
[/TR]
</tbody>[/TABLE]

How can i accommodate all of these varietals ?
 
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values

hi

i just realized a little issue with my data set i can have the column as follows

[TABLE="width: 500"]
<tbody>[TR]
[TD]AA123~~
[/TD]
[/TR]
[TR]
[TD]AA123~845612~[/TD]
[/TR]
[TR]
[TD]AA123 TOTAL[/TD]
[/TR]
[TR]
[TD]BB123~~[/TD]
[/TR]
[TR]
[TD]BB123~845613~[/TD]
[/TR]
[TR]
[TD]BB123~X45665~[/TD]
[/TR]
[TR]
[TD]BB123~h12541~[/TD]
[/TR]
[TR]
[TD]BB123 TOTAL[/TD]
[/TR]
[TR]
[TD]ETC....[/TD]
[/TR]
</tbody>[/TABLE]

How can i accommodate all of these varietals ?

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

=IFERROR(INDEX($A$2:$A$9,SMALL(IF(ISNUMBER(SEARCH("|"&$F$1,"|"&$A$2:$A$9)),ROW($A$2:$A$9)-ROW(INDEX($A$2:$A$9,1,1))+1),ROWS($F$2:F2))),"")

This lists the items with TOTAL also. The following formula instead of the foregoing excludes such items.

=IFERROR(INDEX($A$2:$A$9,SMALL(IF(1-ISNUMBER(SEARCH("TOTAL",$A$2:$A$9)),IF(ISNUMBER(SEARCH("|"&$F$1,"|"&$A$2:$A$9)),ROW($A$2:$A$9)-ROW(INDEX($A$2:$A$9,1,1))+1)),ROWS($F$2:F2))),"")

In G2 just enter, copy across, and down:

=IF($F2="","",INDEX($A$2:$C$9,MATCH(SUBSTITUTE($F2,"~","~~"),$A$2:$A$9,0),MATCH(G$1,$A$1:$C$1,0)))
 
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values

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

=IFERROR(INDEX($A$2:$A$9,SMALL(IF(ISNUMBER(SEARCH("|"&$F$1,"|"&$A$2:$A$9)),ROW($A$2:$A$9)-ROW(INDEX($A$2:$A$9,1,1))+1),ROWS($F$2:F2))),"")

This lists the items with TOTAL also. The following formula instead of the foregoing excludes such items.

=IFERROR(INDEX($A$2:$A$9,SMALL(IF(1-ISNUMBER(SEARCH("TOTAL",$A$2:$A$9)),IF(ISNUMBER(SEARCH("|"&$F$1,"|"&$A$2:$A$9)),ROW($A$2:$A$9)-ROW(INDEX($A$2:$A$9,1,1))+1)),ROWS($F$2:F2))),"")

In G2 just enter, copy across, and down:

=IF($F2="","",INDEX($A$2:$C$9,MATCH(SUBSTITUTE($F2,"~","~~"),$A$2:$A$9,0),MATCH(G$1,$A$1:$C$1,0)))

HI

Thank you very much for the formula

i was wondering if perhaps you can convert this formula to a vba, so for ex.
I would enter a customer number in cell F1 and click a button and it would list all invoices underneath just like the formula does

Thanks
 
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values

Hi,

Looking for a Formula ... or for a Macro...???

Seems you are back to the Filter solution ...:wink:
 
Last edited:
Upvote 0
Re: How To VLOOKUP And Return Multiple Corresponding Values

HI

Since my sheets have a lot of data an array formula like above is taking to long i was thinking that a vba is probably faster
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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