Help with a vlookup formula

STIRRELL

Board Regular
Joined
Dec 30, 2010
Messages
62
Office Version
  1. 365
Hi everyone ,
I need help with a lookup. I have one spreadsheet that has the invoice number, and on a second spreadsheet they combined all the open invoice numbers in a single cell by PO, I need help with a vlookup that can search the column A for the single invoice number and return the PO associated in column B

So for example on Spreadsheet Invoices 7_19_23 in Column E I have a list of invoice numbers and need to return the PO number to column T ( PO #)


Spreadsheet 7_19_23
A
Invoice Number

A64347

PO_List
A
Associated Invoice(s)
A64297(780.00),A64253(87,987.70),A64226(103,547.54),A64227(2,913.60),A64100(4,414.00),A64303(106,137.23),A64346(66,367.04),A64354(393.16),A64153(46,089.76),A64323(172,845.17),A64304(5,260.00),A64173(115,383.96),A64347(84,167.08)

Return the PO number in Column B

Is there a vlookup Match or other combination to search the string in column A on the PO List tab and return the po number in column B
 

Attachments

  • PO List.JPG
    PO List.JPG
    18.8 KB · Views: 9
  • Invoices 7_19_23.JPG
    Invoices 7_19_23.JPG
    23 KB · Views: 10

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I'm not sure I have a good grip on what you want here...
MrExcelPlayground18.xlsx
ABCDE
1Purchase OrderInvoiceslookup
2AA12345(1,000.00),A10000(2,000.00),A20000(15,000.00)A1235B
3BA1235(3,000.00),A11000(21,000.00),A22000(1,000.00)C12345D
4CA12(1,500.00),A10(2,500.00),A20(5,000.00)A10000A
5DB12345(1,000.00),B10000(2,000.00),B20000(15,000.00),C12345(1,000.00),C10000(2,000.00),C20000(15,000.00)A20000A
Sheet26
Cell Formulas
RangeFormula
E2:E5E2=FILTER($A$2:$A$5,NOT(ISERR(SEARCH(","&D2&"(",","&$B$2:$B$5))))
 
Upvote 0
Here is a small test sheet with Formulas you might be able to use:

GetLastRow.xlsm
ABCD
35PO Number to findA643070NOT FOUND
36NOT FOUNDXXXXXX
Sheet3
Cell Formulas
RangeFormula
C35C35=IFERROR(FIND(B35,A34),0)
D35D35=IF(C35>0,"FOUND","NOT FOUND")
A36A36=IF(C35>0,"FOUND","NOT FOUND")
B36B36=IF(A36="FOUND",MID(A34,C35,FIND("(",MID(A34,C35,30))-1),"XXXXXX")


Cell A34 contains the string of PO Numbers
B35 is the PO Number to find
C35 is > 0 if the PO Number is found in the list, or 0 if not found
D35 tests C35 and returns "FOUND" or "NOT FOUND"

If the PO Number is Found you can just copy the cell where you entered the PO number to search for, to your other sheet.

If you need to extract both the PO Number and the value in parenthesis a Bit more work is needed. Please clarify.
 
Upvote 0
Note: If you need the result of the searched to populate a cell other than where you have entered your formula you will need to write a VBA macro (Sub) to do the additional work.

E.g. - write to another sheet and or cell, extract the value in parenthesis after the PO Number and write it to a cell.
 
Upvote 0
Thank you but I need a vlookup formula. The issue is they listed all the open invoices in a single cell for each PO number. So I need the lookup formula to be combined with search function ( or something like that) to be able search in the cells for the specific invoice number and return the po number .

Spreadsheet 1 has the individual invoice number
Spreadsheet 2 has a list of open invoices all in one cell and in the next column is the PO number that I need pulled into spreadsheet 1.
Sample of the combined invoice information on spreadsheet 2

Associated Invoice(s)
A64297(780.00),A64253(87,987.70),A64226(103,547.54),A64227(2,913.60),A64100(4,414.00),A64303(106,137.23),A64346(66,367.04),A64354(393.16),A64153(46,089.76),A64323(172,845.17),A64304(5,260.00),A64
I know how to do a normal lookup , but I dont know how to combine the lookup and the search in one vlookup formula.

thank you for any help.
 
Upvote 0
A few more questions ....
1) Do you have multiple rows of these comma delimited Invoice Number Strings? If you do please send 3 to 5 of these strings to test with.
2) In the worksheet where the stings of invoice number are listed can we add a column? My idea is to create a calculated value (the desired invoice number if it is found) in the new column. The function will parse it base on the value searched.
3) with the additional column a VLOOKUP can then be done to find the PO Number. See one-line example below.

Invoices Table (one or more rows of data)
Col A - Parsed Invoice number, Col B - Strings of Invoices, Col C - PO Number
GetLastRow.xlsm
ABC
33Invoice(s)Invoice(s) StringsPO Number
34A64303A64297(780.00),A64253(87,987.70),A64226(103,547.54),A64227(2,913.60),A64100(4,414.00),A64303(106,137.23),A64346(66,367.04),A64354(393.16),A64153(46,089.76),A64323(172,845.17),A64304(5,260.00),A64173(115,383.96),A64347(84,167.08)PO12345
Sheet3
Cell Formulas
RangeFormula
A34A34=MID(B34,FIND(B35,B34),FIND("(",MID(B34,FIND(B35,B34)+1,30)))


On another sheet you would enter the Invoice Number to be found (like below)
GetLastRow.xlsm
AB
35Invoice Number to findA64303
36PO NumberPO12345
Sheet3
Cell Formulas
RangeFormula
B36B36=VLOOKUP(B35,A34:C34,3)


The first column of the invoices table changes the contents of Col A based on the invoice number searched for. (B36), and
Returns the PO Number in Cell B36
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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