COUNTIF not working with formatted cells

Kingchaos64

New Member
Joined
Jan 15, 2021
Messages
46
Office Version
  1. 365
Platform
  1. Windows
I have a formula of =COUNTIF(E5:OV5,"*-*")

I would like this formula to count all the cells in row 5 that have a dash in them. The cells that have a dashes look like this 00-00-00. To make data entry easier I put a custom formula in the columns and used 00-00-00 as the sample.
Which works great, it makes it super fast to enter the set of numbers without having to put in the dash.

The problem is the COUNTIF formula doesn't recognize the numbers as having dashes so it doesn't count them

Is there a work around to this?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
If you have the custom cell format "##-##-##", any 6-digit number will appear with hyphens.
Then, why do you have to find hyphens, if all the numeric data in the row have hyphens?
Is there any reason why you can't just use =COUNTIF(E5:OV5,"<>")?
 
Upvote 0
If you have the custom cell format "##-##-##", any 6-digit number will appear with hyphens.
Then, why do you have to find hyphens, if all the numeric data in the row have hyphens?
Is there any reason why you can't just use =COUNTIF(E5:OV5,"<>")?
There is other numerical data in the row which I don't want counted but the data I want counted will always be a 6 digit number and none of the other data would be that many numbers. Could I do a countif equals 6 somehow?
 
Upvote 0
See if this counts what you want?
Excel Formula:
=COUNT(FILTER(E5:OV5,LEN(E5:OV5)=6,""))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,492
Messages
6,125,116
Members
449,206
Latest member
burgsrus

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