+ Reply to Thread
Results 1 to 6 of 6

Countif during a month

  1. #1
    Registered User
    Join Date
    08-30-2006
    Posts
    10

    Countif during a month

    I am trying to build a table with Labels of each month. I am trying to find out if there is a way to count the number of items from a different table that have a date between the beginning and ending of the month in the column.

    A2 = Mar
    B2 = countif(E:E, falls within March)

    I can manually do a countifs and say if greater equal to Mar 1 or less than Apr 1 but I wanted to know if there is an easier more dynamic way.

    Thanks.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Countif during a month

    =sumproduct(--(month(e:e)=3))
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    08-30-2006
    Posts
    10

    Re: Countif during a month

    Ok, to step it up a notch let's try this:

    Column A is severity type
    A2 = S1
    A3 = S2
    A4 = S3

    B1 thru D1 are Mar through

    I am trying to count the number of cases that have the corresponding Severity type and fall within that month. The data is in columns F for severity and G for date.

    So B2 should count how many cases from F:G that are S1 and are in the month of Mar

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Countif during a month

    =sumproduct(--(month(G:G)=3)*(F:F="S1"))
    Last edited by tlafferty; 11-04-2011 at 07:44 PM. Reason: closing parenthesis

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Countif during a month

    Please Login or Register  to view this content.
    This approach works as long as the month to search is not January.
    If it is, and if there are values in less than the whole column ( or there are 0's somewhere in the column) you will always get 1048576 as answer.
    So, the real range should be used instead of e:e or the formula could be changed to


    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-30-2006
    Posts
    10

    Re: Countif during a month

    I got it to work. Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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