+ Reply to Thread
Results 1 to 13 of 13

Need to calculate average value every 15 mins

  1. #1
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Need to calculate average value every 15 mins

    Hi guys/gals!

    See the attached sample data.

    I am needing to have a formula that looks in column A. The formula should give an average of the values in column E, every 15 miins, starting at 22:00 and ending at 00:15. So I should get 9 values in total.

    I cannot figure out how to do this as there are multiple values for each minute, rather than 1 value per minute.
    Attached Files Attached Files

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

    Re: Need to calculate average value every 15 mins

    I think your dates in column A are in the format of mm/dd/yyyy, as you go from 12/06/2019 to 12/07/2019, even though they are formatted to show dd/mm/yyyy. It doesn't really matter, as we can extract the time element from those date/times, but I thought I'd point it out to you.

    Pete

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

    Re: Need to calculate average value every 15 mins

    As we are only concerned with time, it would help to split those times away from the dates, so put this formula in cell F2:

    =A2-INT(A2)

    Format that cell as a time (hh:mm:ss), then copy the formula down to the bottom of your data.

    Then you can build up a summary table, so enter your start time (20:00:00) in G2 and put this formula in G3:

    =G2+TIME(0,15,0)

    Format those two cells as a time, then copy G3 down to G11. You will need to change the formula in G10 to this:

    =G9+TIME(0,15,0)-1

    to take account of passing midnight. Then you can use this formula in H2:

    =AVERAGEIFS(E:E,F:F,">="&G2,F:F,"<"&G2+TIME(0,15,0))

    then copy this down to H11.

    Hope this helps.

    Pete

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,309

    Re: Need to calculate average value every 15 mins

    You can also use a pivot table
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Need to calculate average value every 15 mins

    Hi,

    Thanks for ther reply.

    I have used some of your formulae, but have created something slightly different, if not the long way around. However I am coming across something very odd which I do not understand.

    See the cells highlighted in red. For some reason the countif formula falls apart in these cells. I cannot fathom why?? Can you ?

    Cannot upload the file foir some reason, so you https://www.dropbox.com/s/j42b4l74xp...f_fci.zip?dl=0
    Last edited by willm; 12-09-2019 at 05:57 AM. Reason: error

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

    Re: Need to calculate average value every 15 mins

    Did you forget to attach a file?

    Pete

  7. #7
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Need to calculate average value every 15 mins

    Last edited by willm; 12-09-2019 at 08:27 AM. Reason: duff link

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,308

    Re: Need to calculate average value every 15 mins

    read the yellow bars at the head of the page, not everyone (including me) are prepared to use dropbox.

  9. #9
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Need to calculate average value every 15 mins

    Hi,

    OK, I have cut down the sheet in size. So its the cells in red that don't seem to be calaculating as expected.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Need to calculate average value every 15 mins

    Its the rounding of the values and floating point calculation

    try
    =COUNTIF(B:B,MROUND(H2,"00:15")) to force every 15 minutes exactly

    similar adjustments to all your other formula, but I am sure you can do that

  11. #11
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Need to calculate average value every 15 mins

    Hi,

    Strange, it has amended column J, but I am still getting zeros in the averages. See attached.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Need to calculate average value every 15 mins

    I found a workaround. Thanks for your help.

  13. #13
    Registered User
    Join Date
    12-05-2023
    Location
    Philippines
    MS-Off Ver
    Office 365
    Posts
    1

    Re: Need to calculate average value every 15 mins

    Thank you! This was a great help

+ 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. Replies: 3
    Last Post: 01-22-2016, 01:44 AM
  2. Calculate difference between two dates and times in "days, hrs, mins
    By Rajatka in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2013, 03:41 PM
  3. Calculate working hours/mins between 2 date/times
    By MusicSOS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-02-2012, 04:59 AM
  4. Calculate Day, Hours, Mins Seconds
    By vcross in forum Excel General
    Replies: 4
    Last Post: 01-27-2011, 08:32 PM
  5. Calculate Hours & Mins
    By Justinmih in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2008, 11:16 PM
  6. [SOLVED] How can I calculate a value using time duration in mins & secs
    By michaeljohnking in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-16-2006, 10:40 AM
  7. Calculate difference (mins) between 2 Times
    By Max in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-11-2005, 03:05 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