COUNTIFS with wildcard and or function

Cat129

Board Regular
Joined
Oct 20, 2012
Messages
96
I'm stuggling with this formula. I need to do a COUNTIF that uses wildcards and also an or function.

The below is what I started with but then I realised that any cell that contained the exact contents of A8 isn't picked up in the count.

=COUNTIF('Sheet 1'!$Q:$Q,"*"&A8&"*")

Say for example cell A8 Contained "452"

Can anyone help me work out a COUNTIF that looks for "452" and "452, 479" or "124, 452". To try to explain further if the three below examples were in my range the COUNTIF would total 3

[TABLE="width: 500"]
<tbody>[TR]
[TD]452
[/TD]
[/TR]
[TR]
[TD]452, 479[/TD]
[/TR]
[TR]
[TD]124, 452[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
=sumproduct((isnumber(search(","&a8&",",","&substitute(Sheet1!$q$2:$q$400," ","")&","))+0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,735
Messages
6,192,733
Members
453,752
Latest member
Austin2222

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