Countif for a constant value

Spockster

Board Regular
Joined
Jun 9, 2002
Messages
108
I have a sheet that I am doing a match and a countif the value appears. However the value I am looking for is in the middle of other text. It looks something like this. "Outbond Service - 45879 - Services" and I want to be able to count the constant value of "45879" How can this be done. My formula is
=IF(ISNA(COUNTIF(INDEX('Sheet 1'!$1:$65536,0,MATCH("Position Owner",'Sheet 1'!$1:$1,0)),"*""B5""*")),"0",COUNTIF(INDEX('Sheet 1'!$1:$65536,0,MATCH("Position Owner",'Sheet 1'!$1:$1,0)),"*""B5""*"))

The formula works great but now with the text around my value it doesn't count. Any help would be great.

Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try changing the criterion for COUNTIF to...

"*"&B5&"*"

Hope this helps!
 
Upvote 0
Also, I think the following would suffice...

=IF(ISNUMBER(MATCH("Position Owner",'Sheet 1'!$1:$1,0)),COUNTIF(INDEX('Sheet 1'!$1:$65536,0,MATCH("Position Owner",'Sheet 1'!$1:$1,0)),"*"&B5&"*"))

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,203,605
Messages
6,056,251
Members
444,853
Latest member
sam69

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