COUNTIF any part of cell string appears in range

shella

New Member
Joined
Jan 15, 2014
Messages
34
Hello! I'm having issues getting the correct formula to search a range and COUNTIF any part of a cell's text appears anywhere in the range.

Using A as the search criteria and C as the range, I would expect the column B results below, but, in B2/B3 it's returning 0 no matter what formula I try. Any suggestions from you smart folks is very much appreciated!

Thank you very much!

A[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Mango[/TD]
[TD]2[/TD]
[TD]Steak[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Orange/Clementine/Mandarin[/TD]
[TD]3[/TD]
[TD]Pear[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Peach/Nectarine/Apricot[/TD]
[TD]2[/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Pear[/TD]
[TD]2[/TD]
[TD]Honeydew[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Apricot[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Nectarine[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Watercress[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Mango[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Pear[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Clementine[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Mango[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try this:


Book1
ABC
1FruitCountList
2Mango2Steak
3Orange/Clementine/Mandarin3Pear
4Peach/Nectarine/Apricot2Orange
5Pear2Honeydew
6Apricot
7Nectarine
8Watercress
9Orange
10Mango
11Pear
12Clementine
13Mango
Name1
Cell Formulas
RangeFormula
B2=SUMPRODUCT(COUNTIF(A2,"*"&$C$2:$C$13&"*"))
 
Upvote 0
SOLVED: COUNTIF any part of cell string appears in range

Eric,

Thanks so much - that completely worked for the dummy data that I created but didn't give the intended result when I plugged into my actual spreadsheet because my actual range contains blank cells. HOWEVER, the "wrong result" shed enough light for me to realize I just needed to subtract the blank cells in my formula and it now works beautifully.

Thanks very much!!!

Best,
Shella
 
Upvote 0
Re: SOLVED: COUNTIF any part of cell string appears in range

Glad you got it figured out! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
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