Xlookup across large amounts of data in a cell

eechristaylor

New Member
Joined
Oct 22, 2013
Messages
20
Office Version
  1. 365
Platform
  1. Windows
I have a cell with data in it that I know is in the match criteria. The data is in a cell with a large amount of data with it separated by a ";". How can I get it to recognize the data in a large string where it is seperated by a ";"?

For example:
24​
1​
10;24;15;16;17;18;28
101​
2​
11;16;50;55;101;111;124


In B1 I have =XLOOKUP(A1,G1:G2,F1:F2,"",0) looking to return a "1"

Any help would be appreciated!

Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
13,225
Office Version
  1. 365
Platform
  1. Windows
I don't believe that you can do wildcard matching with xlookup.
Excel Formula:
=INDEX($F$1:$F$2,MATCH("*;"&A1&";*",";"&$G$1:$G$2&";",0))

edit:- you can do wildcard matching with xlookup, there is an optional parameter for it that I had missed previously.
Excel Formula:
=XLOOKUP("*;"&A1&";*",";"&G1:G2&";",F1:F2,,2)
 

eechristaylor

New Member
Joined
Oct 22, 2013
Messages
20
Office Version
  1. 365
Platform
  1. Windows
I don't believe that you can do wildcard matching with xlookup.
Excel Formula:
=INDEX($F$1:$F$2,MATCH("*;"&A1&";*",";"&$G$1:$G$2&";",0))

edit:- you can do wildcard matching with xlookup, there is an optional parameter for it that I had missed previously.
Excel Formula:
=XLOOKUP("*;"&A1&";*",";"&G1:G2&";",F1:F2,,2)
Thanks so much but I only got them to work partially, I am working with a big data set and for the xlookup it doesnt pick up the second number in the A row (say A3 was 18 it just shows this as a blank instead of returning the '1").

Then on the INDEX/MATCH combo I get it to work on some but have #N/A where I confirm there is a match, trying to figure out this issue.
 

Alex Blakenburg

Well-known Member
Joined
Feb 23, 2021
Messages
1,205
Office Version
  1. 365
Platform
  1. Windows
I am not really clear on the requirement, a XL2BB screenshot with more rows would help.
Is each lookup only looking on the current row and trying to find if the value in the left column eg column A is in the delimited string in column G on the same row and returning a position number into column F on the same row ?
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
13,225
Office Version
  1. 365
Platform
  1. Windows
Both formulas work fine for me. The ranges are set to the example, for a bigger data set you will need to make sure that the ranges in the formula cover the entire data set.
Book1 (version 1).xlsb
ABCDEFG
12411110;24;15;16;17;18;28
210122211;16;50;55;101;111;124
31811
41011
512422
Sheet2
Cell Formulas
RangeFormula
B1:B5B1=INDEX($F$1:$F$2,MATCH("*;"&A1&";*",";"&$G$1:$G$2&";",0))
C1:C5C1=XLOOKUP("*;"&A1&";*",";"&$G$1:$G$2&";",$F$1:$F$2,,2)
 
Solution

Forum statistics

Threads
1,137,113
Messages
5,679,697
Members
419,850
Latest member
Cbell07958

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
Top