+ Reply to Thread
Results 1 to 7 of 7

Average over last 120 days with blank cells

  1. #1
    Registered User
    Join Date
    01-29-2020
    Location
    Perth
    MS-Off Ver
    Office 365
    Posts
    3

    Average over last 120 days with blank cells

    Hi...

    I'm trying to calculate the average over the last 120 days. However some of the cells may be blank so do not count into the calculation.
    I just can't seem to get the formula right.

    Any assistance will be greatly appreciated.

    For reference as I cannot share data due to non-disclosure agreements:
    Date is in column A
    Numbers will be in column B (will be between 1-5)

  2. #2
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Average over last 120 days with blank cells

    Maybe:

    =AVERAGE(IF((A1:A10>=TODAY()-120)*(A1:A10<=TODAY()),B1:B10,"<>0"))
    Last edited by crazyforexcel; 01-29-2020 at 12:21 PM.

  3. #3
    Registered User
    Join Date
    01-29-2020
    Location
    Perth
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Average over last 120 days with blank cells

    I also need it to only average the numbers if they are within the last 120 days, disregarding anything prior to that.
    The spreadsheet will go back for a full year at least with multiple entries for each day. However again, not all cells will have data in column B.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Average over last 120 days with blank cells

    Try this:

    =AVERAGEIFS(B:B,B:B,"<>0",A:A,"<="&TODAY(),A:A,">="&TODAY()-120)

    Hope this helps.

    Pete

  5. #5
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Average over last 120 days with blank cells

    Use Pete's formula mine isn't working correctly.

  6. #6
    Registered User
    Join Date
    01-29-2020
    Location
    Perth
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Average over last 120 days with blank cells

    Yay! It works. THANK YOU!!!

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Average over last 120 days with blank cells

    Glad to hear it, and thanks for marking the thread as Solved.

    You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Average no. of days if other cells meet multiple criteria
    By Elderlyoutlaw in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-16-2019, 04:01 PM
  2. Replies: 7
    Last Post: 05-04-2017, 10:53 AM
  3. Replies: 2
    Last Post: 07-25-2013, 01:01 PM
  4. Replies: 10
    Last Post: 04-25-2013, 06:12 PM
  5. Average the last 10 cells of a dynamic column but ignore blank cells & 0
    By mattadler22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2013, 11:37 PM
  6. Find a blank cell and calculate the average of all cells above till the next blank
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 11:51 AM
  7. amt of days + non blank cells
    By scabertrain in forum Excel General
    Replies: 6
    Last Post: 09-02-2008, 01:48 PM

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