+ Reply to Thread
Results 1 to 2 of 2

Averageif date within 365 days of cell date

  1. #1
    Registered User
    Join Date
    11-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    72

    Averageif date within 365 days of cell date

    I have a meter tracking excel sheet where I input a meter number on a daily basis. I skip weekends and occasionally week days. After I enter the date and time in column B (m/d/yyyy hh:mm), and the meter reading in Column C,
    Column D provides the Meter delta (=IF(ISBLANK(C525),"",C525-C524)),
    Column E provides the Time Delta (=IF(ISBLANK(C525),"",(B525-B524)*1440)),
    Column F provides the Gallons per minute used (=IF(ISBLANK(C525),"",D525/E525)), and
    Column K provides a trailing 12 month average (=IF(ISBLANK(B525),"",AVERAGE(F513:F525)))

    The issue with Column K is that it averages my averages, which is not an accurate way of doing it. To put it in other words, if my average of 2 days is 10 gallons per minute (GPM) and my average over 5 days is 2 GPM, Column K will result with a trailing 12 month average of 6 GPM when it should have produced 4.28 GPM.

    I'm trying to figure out how to do an averageif formula that will take a range of data, determine if the dates are within 365 days of Column B's date and then SUM Column D and divide by 365/24/60 to provide me with an accurate trailing 12-month average GPM. Any idea's what that formula would be?

    EDIT: After posting and re-reading to proof my own submission, I think I need to be using SUMIF and then dividing it out for my average. I will try this and report back.

    EDIT 2: This is what I came up with, but I'm not getting the result I wanted: =(SUMIFS($D$35:$D$2354,$B$35:$B$2354,">="&B525,$B$35:$B$2354,"<="&(B525-365)))/365/24/60
    Still continuing to troubleshoot the above, but don't want others wasting time on this if I can figure it out.

    EDIT 3: Had my greater than and less than signs reversed. Formula works: =(SUMIFS($D$35:$D$2354,$B$35:$B$2354,"<="&B525,$B$35:$B$2354,">="&(B525-365)))/365/24/60

    Sorry for the useless post. I guess I just needed to read my own question to figure it out.
    Last edited by ipausa; 06-19-2018 at 05:09 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Averageif date within 365 days of cell date

    Thanks for sharing your solution. WE have all done that at some point or another
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Looking to display data in a cell, only if today's date is 7 days past a cell's date
    By mbenderpetassure in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2015, 01:57 PM
  2. Replies: 1
    Last Post: 05-26-2014, 03:46 AM
  3. Replies: 4
    Last Post: 05-08-2014, 10:13 AM
  4. Changing Cell Colour set days before a date and set days after a date.
    By imranrasool in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 04-26-2013, 03:40 AM
  5. [SOLVED] Add the previous days date from the date in the next cell
    By smugglersblues in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2013, 12:06 PM
  6. excel formula: days remaining=end date-todays date+extention days
    By fsprings in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-04-2013, 06:45 AM
  7. [SOLVED] formula to calculate future date from date in cell plus days
    By Chicesq in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-03-2005, 08:30 AM

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