counting months in a a date column with countif

  • Thread starter Thread starter kevinherring
  • Start date Start date
K

kevinherring

i have a column of dates in the format dd/mm/yyyy

i want to count the number of entries for each month, but how do i ge
the month out of the date?

=COUNTIF(A5:A21, 3) (where 3 is march) doesnt work as countif i
looking at the serial number of the date, not the month

what i want is something like


=COUNTIF(month(A5:A21), 3)

but of course that doesnt work with a range....

thanks for any help
kevi
 
i have a column of dates in the format dd/mm/yyyy

i want to count the number of entries for each month, but how do i get
the month out of the date?

=COUNTIF(A5:A21, 3) (where 3 is march) doesnt work as countif is
looking at the serial number of the date, not the month

what i want is something like


=COUNTIF(month(A5:A21), 3)

but of course that doesnt work with a range....

thanks for any help
kevin

If you want to count the number of entries in a particular month & year, then

=COUNTIF(rng, ">="&DATE(2003,2,1)) - COUNTIF(rng,">"&DATE(2003,2,28)
for Feb 2003. You can substitute a cell containing the Date range of the DATE
function.


If you want to count the number of entries for a particular month, irrespective
of the year, then one way is to set up a "helper column". In the first row put
the formula =cell where cell is the location of the first DATE in rng.
Copy/drag it down. Then you can use a formula referencing that column, of the
type: =COUNTIF(helpercolumn,2) for a February count.



--ron
 
Back
Top