Count Strings Within Cell from List of Strings

maertesa

New Member
Joined
Oct 30, 2015
Messages
2
Hello,
I've learned a lot by lurking on this forum but haven't been able to find anything solving my question so decided to jump in.
I would like to search each cell in column V for items from a list in column Y. I would like column W to show me the number of times those items appear. Ideally, it would only count an item from the list once as shown in W5 below, but it wouldn't be the end of the world if it had to count orange twice.
Column V has a list of foods separated by commas. I would like a formula for column W that tells me how many times items from a separate list (Y) appear in the cell A next to it.


Excel 2010
VWXY
1FoodsCountFruit List
2Apple, steak, pizza, orange2Apple
3Beans, orange, Pizza1Banana
4Beans, Pizza, Steak0Orange
5Orange, Banana, Orange2Pear
6Watermelon
7etc
Sheet1


Thanks!
Sam
 

Excel Facts

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

Try...

W2, copied down:

=SUMPRODUCT(--(ISNUMBER(SEARCH(", "&$Y$2:$Y$6&",",", "&V2&","))))

For a case-sensitive search, replace SEARCH with FIND.

Hope this helps!
 
Upvote 0
Awesome! Thanks for the help! My actual text wasn't quite as clean as my example (didn't always have commas, etc), so I removed the extra commas/spaces from your formula, but it appears to be working with that modification.

Thanks! I love this message board!
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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