Compare two columns row by row, count substring matches

jokr1

New Member
Joined
Jan 10, 2016
Messages
46
I want to compare columns A and B, row by row, where values in B might contain substrings of A.
How can I count the number of substring matches ("am" in hamster, "bit" in rabbit, "us" in mouse and "squirrel" in squirrel) with a formula? (Do not want to use column C at all to indicate if each row is a match or not)

I guess I have to use countifs or sumproduct? But don't know how to do it in this specific case.

1624633438862.png
 
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Substitute SEARCH for FIND if you want to ignore case in your matches.
Book1
ABCD
1frogme
2hamsteram
3catematches
4rabbitbit4
5mouseus
6gorrilahey
7squirrelsquirrel
Sheet2 (2)
Cell Formulas
RangeFormula
D4D4=SUMPRODUCT(--ISNUMBER(FIND($B$1:$B$7,$A$1:$A$7)))
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,432
Members
448,961
Latest member
nzskater

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