+ Reply to Thread
Results 1 to 4 of 4

Count days within 1 calendar year

  1. #1
    Forum Contributor
    Join Date
    10-15-2012
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    167

    Count days within 1 calendar year

    I have the below formula in RESULTS G10 of the attached WB. How do I limit the formula to only count the days within the past 1 rolling calendar year?
    Basically, count & sum days in the past 365 days.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by cableghost; 05-12-2022 at 10:14 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,979

    Re: Count days within 1 calendar year

    What should happen in the case of a Leap Year?

    Try this:

    =SUMPRODUCT(((Table1[DATE]<>"")*(Table1[RISK]<>"")*(Table1[DATE]>=TODAY()-365))/COUNTIFS(Table1[DATE],Table1[DATE]&""))

    or this:

    =SUMPRODUCT(((Table1[DATE]<>"")*(Table1[RISK]<>"")*(Table1[DATE]>=EDATE(TODAY(),-12)))/COUNTIFS(Table1[DATE],Table1[DATE]&""))
    Last edited by AliGW; 05-12-2022 at 01:29 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    10-15-2012
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    167

    Re: Count days within 1 calendar year

    Thanks Ali for the input.

    Leap Year... I wouldn't be really concerned with it... for these calculations, 1 day will be nominal, as the results for me are simply a ballpark anyhow.

    If I understand the EDATE formula correctly, the -12 is simply calculating EDATE over the past 12 months. I notice both give slightly different results, with the basic -365 a fractional number.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,979

    Re: Count days within 1 calendar year

    The first calculates today minus 365 days.

    EDATE with -12 finds the equivalent date last year (so if today is 12/05/2022, it will return 12/05/2021).

    Use whichever you prefer - that's why I gave yo two options.

+ 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. [SOLVED] Formula to calculate working days and calendar days per month-year ?
    By donny007 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-05-2018, 06:23 PM
  2. Replies: 16
    Last Post: 08-22-2017, 11:20 AM
  3. [SOLVED] Determine # of days between two dates for each calendar year
    By gmazz in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-12-2015, 03:57 PM
  4. Replies: 7
    Last Post: 12-24-2014, 05:03 PM
  5. Replies: 1
    Last Post: 12-24-2014, 03:52 PM
  6. [SOLVED] Count days for specific year falling within in multi-year date range
    By jslo2013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2012, 05:58 PM
  7. Changing calendar based on year with static days
    By reggie1000 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-27-2008, 10:56 AM

Tags for this Thread

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