+ Reply to Thread
Results 1 to 6 of 6

Counting the number of Events that occur in a specific month in a range of days.

  1. #1
    Registered User
    Join Date
    12-09-2013
    Location
    Yellowknife, NT, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Counting the number of Events that occur in a specific month in a range of days.

    Good Day;
    I am trying to figure out how to count the number of Events that have occurred for each month in a year and then place that number into another table which then gets graphed. This will cover five (5) years so I would like an easier way than what I have kluged together.

    The only way I have been able to get it to work is to use a COUNTIF formula but I have to first convert the year and month I am interested from a date value (yyyy-mm) to a numerical date value and then manually enter those numerical date values into the COUNTIF formula.

    This is my COUNTIF formula that I am using: =COUNTIFS($C$2:$C$23,">=41640",$C$2:$C$23,"<41671")

    $C$2:$C$23 is the range of dates (in Date format yyyy-mm-dd).
    41640 is 01 Jan 2014 in numerical date value.
    41671 is 01 Feb 2014 in numerical date value.

    Any ideas how I might do this?

    I have attached my spreadsheet so you have a good idea of what I am trying to do.

    Thanks for the help.


    Kevin
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: Counting the number of Events that occur in a specific month in a range of days.

    pivot table?

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting the number of Events that occur in a specific month in a range of days.

    With E2:E5 containing the 1st of the month dates...

    Entered in G2:

    =COUNTIFS(B$2:B$23,">="&$E2,B$2:B$23,"<="&EOMONTH($E2,0))

    Copy across to H2 then down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Counting the number of Events that occur in a specific month in a range of days.

    in G:

    =COUNTIFS($B$2:$B$23,">=" & E2,$B$2:$B$23,"<=" &EOMONTH(E2,0))

    in H

    =COUNTIFS($C$2:$C$23,">=" &E2,$C$2:$C$23,"<=" & EOMONTH(E2,0))


    No need to convert dates as they are already numbers in Excel and it is comparing numbers when comparing dates.

  5. #5
    Registered User
    Join Date
    12-09-2013
    Location
    Yellowknife, NT, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Thumbs up Re: Counting the number of Events that occur in a specific month in a range of days.

    John and Tony;
    Your solutions were exactly what I was looking for.

    I tried them using my actual data and it worked like a charm.

    I obviously need to get some advanced training in Excel. Can either of you suggest any books that I could purchase to provide me with the advanced functions in Excel?


    ranman256;
    Thank you for your suggestion about a pivot table, but in this instance it would not work for me.

    Again, thank you all very much for your suggestions.


    Kevin
    Last edited by krowe111; 08-16-2015 at 09:59 PM.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting the number of Events that occur in a specific month in a range of days.

    Quote Originally Posted by krowe111 View Post
    Can either of you suggest any books that I could purchase to provide me with the advanced functions in Excel?
    There are a couple of Excel related book lists at this link:

    http://www.contextures.com/tiptech.html#Go_B

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Counting number of events by type and month
    By RossHowie in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-23-2015, 07:05 AM
  2. Count number of events per month in a range
    By cpots13 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-27-2013, 04:03 PM
  3. Counting the Number of Workdays Specific to a Month in Larger Range
    By dmbatcofc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2013, 12:28 PM
  4. Need help returning the number of times 2 events occur simultaneously
    By dudakia in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-30-2012, 06:49 PM
  5. Need help returning the number of times 2 events occur simultaneously
    By dudakia in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-20-2012, 09:05 PM
  6. Counting number of events after a specific hour
    By jugdish in forum Excel General
    Replies: 3
    Last Post: 11-03-2010, 12:59 PM
  7. Counting in specific events in a date range
    By chamaile0n in forum Excel General
    Replies: 5
    Last Post: 08-18-2008, 04:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1