Xlookup to pull data and count words separated by comma

eechristaylor

New Member
Joined
Oct 22, 2013
Messages
47
Office Version
  1. 365
Platform
  1. Windows
I have a cell in one worksheet that lists counties seperated by a comma, this is column X the input is
pike, pinellas, troup
So what I am looking for is a return of 3. I can get this by using

LEN($X$4)-LEN(SUBSTITUTE($X$4,",",""))+1 but then I need to get to this field by using xlookup. I will want to look at cell B1 tthe project name and then reference the other worksheet Column A which has the project nmae and then return the "3" from the three counties in column X.

So i am trying to incorporate the LEN formula embedded in the xlookup but i get an error.

Thanks for your help.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try:
Book2
AB
1pike, pinellas, troup3
2pike, pinellas2
3pike1
Sheet1
Cell Formulas
RangeFormula
B1:B3B1=COUNTA(TEXTSPLIT(A1,",",,1))
 
Upvote 0
How about like
Excel Formula:
=ROWS(TEXTSPLIT(XLOOKUP(B1,Sheet1!A2:A1000,Sheet1!X2:X1000),,","))
 
Upvote 0

Forum statistics

Threads
1,226,466
Messages
6,191,197
Members
453,646
Latest member
SteenP

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