Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Keith Brown
 
Posts: n/a
Default Count the occurances of a month in a range of date fields

I am needing to count the number of times each month is repeated in a column.
The column is a date field in MM/DD/YY format. I attempted to change the
format to MMMM DD, YYYY format (e.g. January 1, 2005) and count off of the
word January, but that did not work (=COUNTIF(C:C,"*January*")).

Is there way to find out how many times a month is repeated?

Thank you
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

One way

=SUMPRODUCT(--(ISNUMBER(C1:C1000)),--(MONTH(C1:C1000)=1))

note that you cannot use this formula with C:C, you need to specify
something like C1:C1000

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)



"Keith Brown" wrote in message
...
I am needing to count the number of times each month is repeated in a
column.
The column is a date field in MM/DD/YY format. I attempted to change the
format to MMMM DD, YYYY format (e.g. January 1, 2005) and count off of the
word January, but that did not work (=COUNTIF(C:C,"*January*")).

Is there way to find out how many times a month is repeated?

Thank you



  #3   Report Post  
Jason Morin
 
Posts: n/a
Default

Try:

=SUMPRODUCT(--(TEXT(C1:C30,"mmm")="Jan"))

HTH
Jason
Atlanta, GA

"Keith Brown" wrote:

I am needing to count the number of times each month is repeated in a column.
The column is a date field in MM/DD/YY format. I attempted to change the
format to MMMM DD, YYYY format (e.g. January 1, 2005) and count off of the
word January, but that did not work (=COUNTIF(C:C,"*January*")).

Is there way to find out how many times a month is repeated?

Thank you

  #4   Report Post  
Keith Brown
 
Posts: n/a
Default

For the first response I modified it to =SUMPRODUCT(--(MONTH($H$6:$H$155)=1))
and I am getting a #VALUE!

For the second response I modified it to
=SUMPRODUCT(--(MONTH($H$6:$H$155)=1)) and I am getting 37 but I only have two
dates in that column with a month of January.

Any other ideas?



"Keith Brown" wrote:

I am needing to count the number of times each month is repeated in a column.
The column is a date field in MM/DD/YY format. I attempted to change the
format to MMMM DD, YYYY format (e.g. January 1, 2005) and count off of the
word January, but that did not work (=COUNTIF(C:C,"*January*")).

Is there way to find out how many times a month is repeated?

Thank you

  #5   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

1. You have text and not excel dates or you have mixed values where some of
your values are text
2. You probably have blank cells which will be counted as January, try this
version of Jason's formula

=SUMPRODUCT(--(TEXT(H6:H155,"mmm")="Jan"),--(H6:H155<""))

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)



"Keith Brown" wrote in message
...
For the first response I modified it to
=SUMPRODUCT(--(MONTH($H$6:$H$155)=1))
and I am getting a #VALUE!

For the second response I modified it to
=SUMPRODUCT(--(MONTH($H$6:$H$155)=1)) and I am getting 37 but I only have
two
dates in that column with a month of January.

Any other ideas?



"Keith Brown" wrote:

I am needing to count the number of times each month is repeated in a
column.
The column is a date field in MM/DD/YY format. I attempted to change
the
format to MMMM DD, YYYY format (e.g. January 1, 2005) and count off of
the
word January, but that did not work (=COUNTIF(C:C,"*January*")).

Is there way to find out how many times a month is repeated?

Thank you





  #6   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

=SUMPRODUCT(--(DATE(YEAR($H$6:$H$155),MONTH($H$6:$H$155),1)=J2))

where J2 houses the criterion mont/year, that is, a true date, set to
show the first of the mont/year, like 1-Jan-2005 or a formula like:

=DATE(2005,1,1)

Keith Brown wrote:
For the first response I modified it to =SUMPRODUCT(--(MONTH($H$6:$H$155)=1))
and I am getting a #VALUE!

For the second response I modified it to
=SUMPRODUCT(--(MONTH($H$6:$H$155)=1)) and I am getting 37 but I only have two
dates in that column with a month of January.

Any other ideas?



"Keith Brown" wrote:


I am needing to count the number of times each month is repeated in a column.
The column is a date field in MM/DD/YY format. I attempted to change the
format to MMMM DD, YYYY format (e.g. January 1, 2005) and count off of the
word January, but that did not work (=COUNTIF(C:C,"*January*")).

Is there way to find out how many times a month is repeated?

Thank you

  #7   Report Post  
Keith Brown
 
Posts: n/a
Default

Peo - thank you that worked wonderful.

"Peo Sjoblom" wrote:

1. You have text and not excel dates or you have mixed values where some of
your values are text
2. You probably have blank cells which will be counted as January, try this
version of Jason's formula

=SUMPRODUCT(--(TEXT(H6:H155,"mmm")="Jan"),--(H6:H155<""))

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)



"Keith Brown" wrote in message
...
For the first response I modified it to
=SUMPRODUCT(--(MONTH($H$6:$H$155)=1))
and I am getting a #VALUE!

For the second response I modified it to
=SUMPRODUCT(--(MONTH($H$6:$H$155)=1)) and I am getting 37 but I only have
two
dates in that column with a month of January.

Any other ideas?



"Keith Brown" wrote:

I am needing to count the number of times each month is repeated in a
column.
The column is a date field in MM/DD/YY format. I attempted to change
the
format to MMMM DD, YYYY format (e.g. January 1, 2005) and count off of
the
word January, but that did not work (=COUNTIF(C:C,"*January*")).

Is there way to find out how many times a month is repeated?

Thank you




  #8   Report Post  
mijoh20
 
Posts: n/a
Default

Hello,

I tried this solution:

=SUMPRODUCT(--(ISNUMBER(A2:A1000)),--(MONTH(A2:A1000)=2))

I got #Value! in the cell. When I take the --(MONTH(A2:A1000)=2)) away
the formula works but counts all cells. What am I doing wrong?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count weekdays in a date range benb Excel Worksheet Functions 1 January 13th 05 02:49 PM
PivotTable - Count by Month Gigi Excel Worksheet Functions 3 January 1st 05 12:30 PM
I have a list of dates that I need to count based on a date range ejb030353 Excel Worksheet Functions 4 November 24th 04 02:27 PM
How can I sum information in a list with a date range? Dave Excel Worksheet Functions 2 November 23rd 04 08:17 PM
Excel: How to return count for each cell within date range criter. Louisa Excel Worksheet Functions 0 November 5th 04 11:58 AM


All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"