SOLVED

Counting rows with specific dates

Copper Contributor

Hi I am trying to count the number or rows with an August date from the following data

18/08/2023
18/08/2023
16/08/2023
15/08/2023
08/08/2023
04/08/2023
04/08/2023
02/08/2023
02/08/2023
02/08/2023
26/07/2023
25/07/2023
19/04/2023
14/02/2023
09/02/2023

I am using this formula =COUNTIF(A1:A15,"<01/08/2023") but it as giving me the answer 5 when I need it to give me the answer 10 as I need to count each occurrence of a date.

 

3 Replies
best response confirmed by HansVogelaar (MVP)
Solution

@NatashaTF But that's what's in your formula. Count the number of dates before August 1.

Use this in stead:

=COUNTIF(A1:A15,">=01/08/2023")

 

Or use COUNTIFS like this in case you explicitly want to set the upper and lower date limits.

=COUNTIFS(A1:A15,"<=31/08/2023",A1:A15, ">=01/08/2023")

Thank you: i was being a bit dumb I see ;)

@NatashaTF 

Yet another option:

 

=SUMPRODUCT((YEAR(A1:A15)=2023)*(MONTH(A1:A15)=8))

1 best response

Accepted Solutions
best response confirmed by HansVogelaar (MVP)
Solution

@NatashaTF But that's what's in your formula. Count the number of dates before August 1.

Use this in stead:

=COUNTIF(A1:A15,">=01/08/2023")

 

Or use COUNTIFS like this in case you explicitly want to set the upper and lower date limits.

=COUNTIFS(A1:A15,"<=31/08/2023",A1:A15, ">=01/08/2023")

View solution in original post