Find 6 digit PO using Xlookup in a string of POs in a cell.

MrIDontKnow

New Member
Joined
Feb 29, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Trying to use xlookup to search a 6 digit PO# in column of cells that contain multiple POs separated by commas "," or slashes "/" to bring back an invoice #. Some of the POs may have dashes "-", example 4023454-4. Any suggestions?


INV#PO#'S
001 - EMI-10046-22426451
EI-14887/22429273
20221118
D082922-EXT-A419913, 426453
D090822-EXT-A
6000088306B427938
D101022-EXT-A425895
W221219E-S
EMI-12136-22430746
EI-14892-22430493
EMI-12136-22430746
D010623-EXT-A430749, 431899
14897-23432276
14897-23432276
6000089566431018, 429859
W230213E-S
W230301E-S417063-10-1
W230327E-S
W230508E-S
ET-14917-23437048
W230612E-S402345-4-4 , 410717-5-1, 413067-4-1 , 416013-5-1, 416884-15-4 , 416886-8-2, 417158-11-2, 417381-6-1 , 423754-4-1, 423818-2-2, 423943-7-1 , 424002-5-1 , 424002-5-4 , 424051-11-3, 424051-11-7 , 424051-11-8, 424525-6-1 , 424525-6-2, 424642-2-3 , 424827-3-1 , 424959-3-1, 424986-5-1, 426625-3-1 , 428267-1-1, 428336-1-1, 428369-3-1 , 428529-1-1, 428533-6-5, 429956-4-1, 430860-1-2, 431933-1-1, 436667-1
3920656438997,S230612,438954,439175
W230703E-S416886-8-2, 419764-10-1, 423943-10-1, 424002-6-3, 424051-13-4 , 424051-13-5, 424051-13-6, 424525-8-2, 424640-6-3, 424642-2-2 , 424827-3-1 , 424986-5-1, 426141-8-1 , 428533-6-5 , 429956-5-1
W230710E-S423279-6-1, 423943-10-1 , 424051-13-6, 424304-5-1, 424525-8-2, 424827-3-2, 425501-3-1, 426141-8-1, 428096-5-1, 428533-6-5
W230717E-S399277-12-1, 399358-4-1, 404544-13-2, 404545-7-2, 409939-10-2, 412088-9-2, 420032-2-2, 423938-8-3, 423943-11-3, 424051-14-7, 424956-2-1, 426141-8-1, 428533-8-5


PO#INV#
419913=xlookup(E2,
426453
431018
429859
402345
410717
413067
416013
416884
416886
417158
417381
423754
423818
423943
424002
424002
424051
424051
424051
424525
424525
424642
424827
424959
424986
426625
428267
428336
428369
428529
428533
429956
430860
431933
436667
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Welcome to the MrExcel board!

Is this what you want?

24 03 01.xlsm
ABCDEF
1INV#PO#'SPO#INV#
2001 - EMI-10046-22426451419913D082922-EXT-A
3EI-14887/22429273426453D082922-EXT-A
4202211184310186000089566
5D082922-EXT-A419913, 4264534298596000089566
6D090822-EXT-A402345W230612E-S
76000088306B427938410717W230612E-S
8D101022-EXT-A425895413067W230612E-S
9416013W230612E-S
10W221219E-S416884W230612E-S
11EMI-12136-22430746416886W230612E-S
12EI-14892-22430493417158W230612E-S
13EMI-12136-22430746417381W230612E-S
14D010623-EXT-A430749, 431899423754W230612E-S
1514897-23432276423818W230612E-S
1614897-23432276423943W230612E-S
176000089566431018, 429859424002W230612E-S
18W230213E-S424002W230612E-S
19W230301E-S417063-10-1424051W230612E-S
20W230327E-S424051W230612E-S
21W230508E-S424051W230612E-S
22ET-14917-23437048424525W230612E-S
23W230612E-S402345-4-4 , 410717-5-1, 413067-4-1 , 416013-5-1, 416884-15-4 , 416886-8-2, 417158-11-2, 417381-6-1 , 423754-4-1, 423818-2-2, 423943-7-1 , 424002-5-1 , 424002-5-4 , 424051-11-3, 424051-11-7 , 424051-11-8, 424525-6-1 , 424525-6-2, 424642-2-3 , 424827-3-1 , 424959-3-1, 424986-5-1, 426625-3-1 , 428267-1-1, 428336-1-1, 428369-3-1 , 428529-1-1, 428533-6-5, 429956-4-1, 430860-1-2, 431933-1-1, 436667-1424525W230612E-S
243920656438997,S230612,438954,439175424642W230612E-S
25W230703E-S416886-8-2, 419764-10-1, 423943-10-1, 424002-6-3, 424051-13-4 , 424051-13-5, 424051-13-6, 424525-8-2, 424640-6-3, 424642-2-2 , 424827-3-1 , 424986-5-1, 426141-8-1 , 428533-6-5 , 429956-5-1424827W230612E-S
26W230710E-S423279-6-1, 423943-10-1 , 424051-13-6, 424304-5-1, 424525-8-2, 424827-3-2, 425501-3-1, 426141-8-1, 428096-5-1, 428533-6-5424959W230612E-S
27W230717E-S399277-12-1, 399358-4-1, 404544-13-2, 404545-7-2, 409939-10-2, 412088-9-2, 420032-2-2, 423938-8-3, 423943-11-3, 424051-14-7, 424956-2-1, 426141-8-1, 428533-8-5424986W230612E-S
28426625W230612E-S
29428267W230612E-S
30428336W230612E-S
31428369W230612E-S
32428529W230612E-S
33428533W230612E-S
34429956W230612E-S
35430860W230612E-S
36431933W230612E-S
37436667W230612E-S
Inv No
Cell Formulas
RangeFormula
F2:F37F2=XLOOKUP("*"&E2&"*",B$2:B$27,A$2:A$27,"",2)
 
Upvote 1
Try this if 1 PO# have more than 1 INV#

Excel Formula:
=IFERROR(TEXTJOIN(", ",,FILTER($A$2:$A$5,IFERROR(NOT(1-SEARCH("*"&E2&"*",$B$2:$B$5)),FALSE))),"Not Found")

1709256370266.png
 
Upvote 1
Try this if 1 PO# have more than 1 INV#

Excel Formula:
=IFERROR(TEXTJOIN(", ",,FILTER($A$2:$A$5,IFERROR(NOT(1-SEARCH("*"&E2&"*",$B$2:$B$5)),FALSE))),"Not Found")
By my reading that is not what was asked for ..
bring back an invoice #
.. but if it is what is wanted there is no need for wildcard characters or any IFERROR functions. For your sample data this would do the same thing.
Excel Formula:
=TEXTJOIN(", ",,FILTER(A$2:A$5,ISNUMBER(FIND(E2,B$2:B$5)),"Not Found"))
 
Upvote 1
Solution
Thanks, I'll try all three. I was also given a new task to find multiple invoices. I'll let you all know. thanks again.
 
Upvote 0
I was also given a new task to find multiple invoices.
If you don't want those multiple invoices listed in a single cell like the formulas in posts 5 & 6 do then you could consider something like this.

24 03 01.xlsm
BCDEGHIJ
1PO#'SPO#
2426451419913D082922-EXT-A
3429273426453D082922-EXT-A
44310186000089566
5419913, 4264534298596000089566
6402345W230612E-S
7427938410717W230612E-S
8425895413067W230612E-S
9416013W230612E-S
10416884W230612E-S
11430746416886W230612E-SW230703E-S
12430493417158W230612E-S
13430746417381W230612E-S
14430749, 431899423754W230612E-S
15432276423818W230612E-S
16432276423943W230612E-SW230703E-SW230710E-SW230717E-S
17431018, 429859424002W230612E-SW230703E-S
18424002W230612E-SW230703E-S
19417063-10-1424051W230612E-SW230703E-SW230710E-SW230717E-S
20424051W230612E-SW230703E-SW230710E-SW230717E-S
21424051W230612E-SW230703E-SW230710E-SW230717E-S
22437048424525W230612E-SW230703E-SW230710E-S
23402345-4-4 , 410717-5-1, 413067-4-1 , 416013-5-1, 416884-15-4 , 416886-8-2, 417158-11-2, 417381-6-1 , 423754-4-1, 423818-2-2, 423943-7-1 , 424002-5-1 , 424002-5-4 , 424051-11-3, 424051-11-7 , 424051-11-8, 424525-6-1 , 424525-6-2, 424642-2-3 , 424827-3-1 , 424959-3-1, 424986-5-1, 426625-3-1 , 428267-1-1, 428336-1-1, 428369-3-1 , 428529-1-1, 428533-6-5, 429956-4-1, 430860-1-2, 431933-1-1, 436667-1424525W230612E-SW230703E-SW230710E-S
24438997,S230612,438954,439175424642W230612E-SW230703E-S
25416886-8-2, 419764-10-1, 423943-10-1, 424002-6-3, 424051-13-4 , 424051-13-5, 424051-13-6, 424525-8-2, 424640-6-3, 424642-2-2 , 424827-3-1 , 424986-5-1, 426141-8-1 , 428533-6-5 , 429956-5-1424827W230612E-SW230703E-SW230710E-S
26423279-6-1, 423943-10-1 , 424051-13-6, 424304-5-1, 424525-8-2, 424827-3-2, 425501-3-1, 426141-8-1, 428096-5-1, 428533-6-5424959W230612E-S
27399277-12-1, 399358-4-1, 404544-13-2, 404545-7-2, 409939-10-2, 412088-9-2, 420032-2-2, 423938-8-3, 423943-11-3, 424051-14-7, 424956-2-1, 426141-8-1, 428533-8-5424986W230612E-SW230703E-S
28426625W230612E-S
29428267W230612E-S
30428336W230612E-S
31428369W230612E-S
32428529W230612E-S
33428533W230612E-SW230703E-SW230710E-SW230717E-S
34429956W230612E-SW230703E-S
35430860W230612E-S
36431933W230612E-S
37436667W230612E-S
Inv No
Cell Formulas
RangeFormula
G2:G10,G12:G15,G26,G28:G32,G35:G37,G34:H34,G33:J33,G27:H27,G25:I25,G24:H24,G22:I23,G19:J21,G17:H18,G16:J16,G11:H11G2=TRANSPOSE(FILTER(A$2:A$27,ISNUMBER(FIND(E2,B$2:B$27)),"Not Found"))
 
Upvote 0

Forum statistics

Threads
1,215,098
Messages
6,123,082
Members
449,094
Latest member
mystic19

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