+ Reply to Thread
Results 1 to 12 of 12

Counting based on DATE values

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Romania, Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    17

    Counting based on DATE values

    Hi guys,

    just having a small problem, i have 2 colums 1 with names and 1 with dates, like in the file i attached :count.xlsx
    what i have to do is like : i need to count the names of which dates are not older than 3 months (1 quarter). shortly , if there are 3 out of 4 names that are between today and the date of 3 months ago, they should be counted. i get in trouble with the dates, always getting me "value" errors. any ideas?

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Counting based on DATE values

    test this out and see if you get the result you are looking for

    =COUNTIF(D6:D9,">"&TODAY()-90)
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: Counting based on DATE values

    See the attached modified workbook. This work is done using 2 things(Autofilter for the date range & worksheet function SUBTOTAL:COUNT).
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-01-2012
    Location
    Romania, Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting based on DATE values

    Quote Originally Posted by DGagnon View Post
    test this out and see if you get the result you are looking for

    =COUNTIF(D6:D9,">"&TODAY()-90)
    it kinda helped, i was looking a formula with EDATE function or EOMONTH but i guess this does the magic.

  5. #5
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Counting based on DATE values

    i could change it to specificaly look for 3 months ago, what date would it be looking for as of today? Feb 1st, or Jan 5th?

  6. #6
    Registered User
    Join Date
    03-01-2012
    Location
    Romania, Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting based on DATE values

    Quote Originally Posted by Dennis7849 View Post
    See the attached modified workbook. This work is done using 2 things(Autofilter for the date range & worksheet function SUBTOTAL:COUNT).
    if i try to add a date that is older than 3 months , it still counts the name. so its not working for me

  7. #7
    Registered User
    Join Date
    03-01-2012
    Location
    Romania, Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting based on DATE values

    Quote Originally Posted by DGagnon View Post
    i could change it to specificaly look for 3 months ago, what date would it be looking for as of today? Feb 1st, or Jan 5th?
    Jan 5th should it be.

  8. #8
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Counting based on DATE values

    Try it like this

    =COUNTIF(D6:D9,">"&DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())))

  9. #9
    Registered User
    Join Date
    03-01-2012
    Location
    Romania, Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting based on DATE values

    Quote Originally Posted by DGagnon View Post
    Try it like this

    =COUNTIF(D6:D9,">"&DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())))
    it works pretty good, but if i change from 1/1/2012 to 2/1/2012 it still counts it , tho today() returns the 5th of April. Substracting 3 months would be 5th of January, so any value under 5th of Jan should not be counted.

  10. #10
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Counting based on DATE values

    2/1/2012 is February 1st, so it should be included.

  11. #11
    Registered User
    Join Date
    03-01-2012
    Location
    Romania, Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting based on DATE values

    Quote Originally Posted by DGagnon View Post
    2/1/2012 is February 1st, so it should be included.
    Right, it's working good . I misunderstood the date format. Thank you very much!

  12. #12
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Counting based on DATE values

    How do you want to count if TODAY is May 31?

    That one will count > Mar 2. If you want count > Feb 29, try with EDATE

    =COUNTIF(D6:D9,">"&EDATE(TODAY(),-3))

    If DLL got an attention on this thread, will have a powerful answer
    Last edited by Haseeb Avarakkan; 04-05-2012 at 04:10 PM.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ 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