COUNTIF cell contains date

My apologies if this relatively simple question has already been covered but I've not been able to find it.


I would like to know how to count the number of cells in column which contain a date (any date).

The spreadsheet is used to monitor my submission of cartoons to various publications. I enter a date when a cartoon is sold and an x when it is rejected.


I've managed to count the number of rejections (x's) by entering:

But I don't know how to count the entries which are dates as each one is different.

Can anyone help me please?


iMac 21.5″, macOS 10.14

Posted on Feb 3, 2021 5:06 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 3, 2021 11:14 AM

Hi GC,


If the only states of cell in that column are: empty, contains date, contains "x", then this should work:


=COUNTA(H3:H459)-COUNTIF(H3:H459,"x")


Regards,

Barry


Similar questions

9 replies

Feb 3, 2021 7:57 AM in response to GoddardCartoons

If you don't want to change your "text" dates then here are two possibilities I've tested here that work on dates entered as text:




=COUNTIF(B,REGEX("^\d."))


Will count anything that starts with a digit followed by more characters.



=COUNTIF(B,REGEX("^\d\d\.\d\d\.\d\d"))


Will count anything started by two digits followed by a . followed by two digits followed by a . followed by two digits.


Note that you need to "escape" the . with a \.


The B needs to be changed to whatever range you are using.


SG

Feb 3, 2021 5:41 AM in response to GoddardCartoons

The formulas below use column B, yours might be F.


I thought this would be as simple as

=COUNTIF(B,">="&DATE(1,1,1))

which should count all dates >= 01/01/0001 but this formula gives me incorrect results, not counting all dates. It appears to work when written as

=COUNTIF(B,">=1/1/1")

but neither will work for you unless your dates are actually dates. Your cell format is not a standard date&time format on my system. It could be a custom format you created but I am guessing it is text. If it is text, you can count cells that have the form ##.##.## . This should still work even if they are custom formatted dates but I did not test it.

=COUNTIF(B,REGEX("\d\d.\d\d.\d\d"))

Feb 4, 2021 2:14 AM in response to GoddardCartoons

Pretty straightforward message. It's telling you that the formula in the selected row is set to get information from the cell containing the formula,


Change the range of cells in the formula to end with the cell above the one containing the formula,or, if you have used a full column (letter only) reference to identify the range, convert the bottom row to a Footer row. For many functions, this keeps the full column range from extending into the footer row and causing that self-reference error.


Regards,

Barry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

COUNTIF cell contains date

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.