+ Reply to Thread
Results 1 to 8 of 8

How to count date as a criteria in countifs

  1. #1
    Registered User
    Join Date
    02-03-2011
    Location
    Bagram Airfield, Afghanistan
    MS-Off Ver
    Excel 2007
    Posts
    10

    Question How to count date as a criteria in countifs

    I have a spreadsheet that I am trying to tally 4 different criteria. I understand countifs in a basic sense, but I cannot get it to count the date (month only) as one of the criteria. The date is entered has month, day, and year entered.

    Am I off base using countifs?

    Your input is appreciated. I have an example attached.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: How to count date as a criteria in countifs

    Hiya - reading your post and looking at your spreadsheet I am not totally clear as to what it is you want to achieve.

    Could you add further details?
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  3. #3
    Registered User
    Join Date
    02-03-2011
    Location
    Bagram Airfield, Afghanistan
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to count date as a criteria in countifs

    Here is an updated sheet. For instance, I want to see how many toyotas had engine work that was done for a dealer in March. Thanks!
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,429

    Re: How to count date as a criteria in countifs

    You can use a SUMPRODUCT formula.

    Or maybe you would be better off with a pivot table.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  5. #5
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: How to count date as a criteria in countifs

    Edit - lol I see there is alot of action already,,,,,,,,,,, Hi Andy!

    hiya - got it.

    Just popping out now but will post back with something within a couple of hours.

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

    Re: How to count date as a criteria in countifs

    Quote Originally Posted by Andy Pope View Post
    Or maybe you would be better off with a pivot table.
    Does 2007 allow grouping date fields if they contain blanks ( which is the case here)?

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,429

    Re: How to count date as a criteria in countifs

    You can group by month and then uncheck the blank row.

    Or as in my example I used the ThisMonth filter which automatically excluded the blanks.

    Acutally the blank dates will impact on the formula provided as the blanks will be included in January month.
    So the sumproduct would need a test for non blanks

    =SUMPRODUCT((A2:A15=G2)*(B2:B15=G3)*(C2:C15=G4)*(MONTH(D2:D15)=MONTH(G5))*(D2:D15<>""))

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: How to count date as a criteria in countifs

    Here's another approach using Data Validation, a Helper Column(E) whch can be hidden, and COUNTIFS as you are using 2007.

    Select from the drop-Downs H2:H5

    To see the Lookups and Helper Column toggle the Grouping Buttons +/- below the formula bar.

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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