Return a Value by looking for a text string in entire column

ckrxb

New Member
Joined
Jul 19, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all-

Thanks in advance for anyone who can look at this! I have what I think is a pretty simple task that I cannot figure out. Our new system puts all of our barcodes into one cell for our products separated by a space. Our old one would put a separate row entry with repeating product names. I am just looking for a way to look through that cell with multiple barcodes, find it when presented on another sheet and return the accompanying product description. The amount of barcodes in each cell is dynamic as is the amount of items (currently around 17,500) since this report includes any new items each week

So sheet 1 would have

DescriptionAlias
COCA COLA 16OZ4900005115
COCA COLA 2.0L049000050103 496390
COCA COLA 20OZ04904403 490440
COCA COLA 500ML(1)049000024685 COCO50CALAA1001
COCA COLA CHERRY 20OZ049000018011 4900004754

On sheet 2 I am trying to get column B to return sheet 1 column A if sheet 2 column A has any of the barcodes manually entered into it like below

490440
COCA COLA 20OZ
COCO50CALAA1001
COCA COLA 500ML(1)

I feel like I was getting close with isnumber(search formulas or the use of a helper column but I would get stuck with a spill error or n/a.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi and welcome to MrExcel

Try:
varios 19jul2023.xlsm
AB
1
2490440COCA COLA 20OZ
3COCO50CALAA1001COCA COLA 500ML(1)
Sheet2
Cell Formulas
RangeFormula
B2:B3B2=LOOKUP(2,1/(ISNUMBER(SEARCH(" "&A2&" "," "&Sheet1!$B$2:$B$20000&" "))),Sheet1!$A$2:$A$20000)



Or in cell B2 on Sheet2 and copy down
Excel Formula:
=FILTER(Sheet1!A2:A20000,ISNUMBER(SEARCH(" "&A2&" "," "&Sheet1!B2:B20000&" ")))

Or simply in cell B2
Excel Formula:
=BYROW(A2:A3,LAMBDA(a,FILTER(Sheet1!A2:A20000,ISNUMBER(SEARCH(" "&a&" "," "&Sheet1!B2:B20000&" ")))))
 
Last edited:
Upvote 0
Solution
That first solution looks to work perfectly! Thanks so much and for such a quick response! :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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