+ Reply to Thread
Results 1 to 5 of 5

Countif on dates (month and year)

  1. #1
    Registered User
    Join Date
    09-17-2008
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    11

    Countif on dates (month and year)

    I would like to count the amount of times 06/2010 appears in a list.

    01/06/2009
    15/05/2010
    13/06/2010
    20/06/2010
    01/07/2010

    So the value I am looking for on the example is 2

    I have managed to get this formula, but not sure if it is anywhere near what I’m after:
    =COUNTIF((H3:H212),"06,2010")

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Countif on dates (month and year)

    Depends on your version really ...

    XL2007+

    =COUNTIFS(H3:H212,">="&DATE(2010,6,1),H3:H212,"<"&DATE(2010,7,1))

    Pre XL2007

    =COUNTIF(H3:H212,">="&DATE(2010,6,1))-COUNTIF(H3:H212,">="&DATE(2010,7,1))

    or

    =SUMPRODUCT(--(TEXT(H3:H212,"MMYYYY")="062010"))

    Else consider using a Pivot Table

  3. #3
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Countif on dates (month and year)

    With your dates in A1 to A5 for example:

    =SUMPRODUCT((TEXT(A1:A5,"mm-yyyy")="06-2010")*1)

    EDIT: Too slow, beaten to it - DonkeyOte have you had 3 Weetabix?
    Last edited by pb71; 07-01-2010 at 04:57 PM.

  4. #4
    Registered User
    Join Date
    09-17-2008
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    11

    Re: Countif on dates (month and year)

    Many thanks for the quick replies. I have used the following that worked.

    =SUMPRODUCT(--(TEXT(H3:H212,"MMYYYY")="062010"))

  5. #5
    Registered User
    Join Date
    08-16-2011
    Location
    Caracas, Venezuela
    MS-Off Ver
    Excel 2003
    Posts
    3

    Thumbs up Re: Countif on dates (month and year)

    Thanks mate, it works perfectly

+ 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