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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
=sumproduct((isnumber(search(","&a8&",",","&substitute(Sheet1!$q$2:$q$400," ","")&","))+0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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