+ Reply to Thread
Results 1 to 14 of 14

Averaging Time Duration

  1. #1
    Registered User
    Join Date
    03-08-2024
    Location
    Portland, OR
    MS-Off Ver
    2019
    Posts
    8

    Averaging Time Duration

    Is there a way to average time durations when formatted like this? (HH:MM:SS) Again, these are durations - NOT times of day.

    06:13:52
    06:35:29
    06:36:13

  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,738

    Re: Averaging Time Duration

    Try this:

    =AVERAGE(A1:A3)

    Format the cell as [h]:mm:ss

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    03-08-2024
    Location
    Portland, OR
    MS-Off Ver
    2019
    Posts
    8

    Re: Averaging Time Duration

    Hi Pete,

    It didn't work. I formatted the cells, but I'm still getting the #DIV/0! error.

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

    Re: Averaging Time Duration

    Those are probably text values, then, that just look like times. Select all the values, click on Data | Text-to-Columns then on Finish, and that should turn them all into numeric values, and the AVERAGE function will work properly.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    03-08-2024
    Location
    Portland, OR
    MS-Off Ver
    2019
    Posts
    8

    Re: Averaging Time Duration

    I'm not quite following on that Pete. Once I Text-to-Columns and average them, I'd have three separate columns that I'd have to put back together. I don't want to text to columns, then concatenate if I don't have to.

  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,738

    Re: Averaging Time Duration

    From your first post, it looked like you had 3 cells of data, each containing one time. From Post #5, however, it would appear that is not the case.

    Please attach a sample Excel workbook by following the guidelines in the yellow banner at the top of the screen, then we can see exactly how your data is laid out.

    Pete

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,065

    Re: Averaging Time Duration

    Try, =AVERAGE(TIMEVALUE(A1:A3)). If this formula works, they are definitely texts.

  8. #8
    Registered User
    Join Date
    03-08-2024
    Location
    Portland, OR
    MS-Off Ver
    2019
    Posts
    8

    Re: Averaging Time Duration

    I've attached a spreadsheet with time duration examples I frequently need to average out. I tried Joseph's formula, and it seemed to work, though it turned the duration into an AM/PM time.
    Attached Files Attached Files

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

    Re: Averaging Time Duration

    There are a lot of times in that sheet, many of them showing fractions of a second - i.e. all columns except for column M (Interacting).

    Is that the column that you want to average? Those time values look like text values, as I pointed out in Post #4. Are those values calculated from the other columns, and if so can you please tell us what formula is used?

    Pete

  10. #10
    Registered User
    Join Date
    03-08-2024
    Location
    Portland, OR
    MS-Off Ver
    2019
    Posts
    8

    Re: Averaging Time Duration

    Hi Pete,

    This data is pulled from a program I use at work, and the times are not calculated from other columns. I use text-to-columns to remove the milliseconds before I do the manual averaging out, and I did that on Column M to play around with the formulas I was getting here, but the data downloads with the milliseconds.

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

    Re: Averaging Time Duration

    Every one of the times in column M has a preceding space before the numbers, which converts the value into text. One easy way to get rid of those spaces and convert the values to proper times is to select column M and then use Find&Replace (Ctrl-H) to find space and replace it with nothing. This formula:

    =AVERAGE(M9:M45)

    would then return 05:08:53 as blanks are not included in the AVERAGE function.

    Hope this helps.

    Pete

  12. #12
    Registered User
    Join Date
    03-08-2024
    Location
    Portland, OR
    MS-Off Ver
    2019
    Posts
    8

    Re: Averaging Time Duration

    So I did the find and replace, then used the average formula, but when I double checked the math manually, there was a math error on the seconds.

    7:16:16
    0:34:56
    0:34:17
    7:12:42
    6:16:09
    4:22:52 <--- Average (math says 52 should actually be 28).

    Please let me know if I'm still doing something incorrect.

  13. #13
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,572

    Re: Averaging Time Duration

    I think that 4:22:52 is correct.
    Check by doing this:
    1. Get the sum of 7:16:16; 0:34:56; 0:34:17; 7:12:42 and 6:16:09 (21:54:20)
    2. Multiply 4:22:52 by 5 (21:54:20)
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

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

    Re: Averaging Time Duration

    Quote Originally Posted by raemaurer21 View Post
    ... when I double checked the math manually, there was a math error on the seconds....
    I can see how you arrived at your answer of 4:22:28 - by separating the individual hours, minutes and seconds and taking an average of those, like this:

    7 16 16
    0 34 56
    0 34 17
    7 12 42
    6 16 9

    20 112 140 <--- individual totals

    4 22 28 <===divide by 5

    What this disguises, though, is that the average of minutes is actually 22.4, and the 0.4 minutes (or 24 seconds) needs to be added on to the 28 seconds shown to give 52 seconds.

    Hope this explains things more clearly.

    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. Custom Formatting Time Duration & Editing A Time Calculation
    By Dexter2 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 03-10-2024, 08:38 PM
  2. [SOLVED] I want a formula that will work out a time duration from one time to another in hours
    By John Henworth in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-29-2021, 06:21 AM
  3. Replies: 5
    Last Post: 09-29-2016, 09:58 PM
  4. Replies: 2
    Last Post: 07-14-2015, 02:12 PM
  5. [SOLVED] How to create a real time report with on/off time and duration?
    By Why123 in forum Excel General
    Replies: 7
    Last Post: 11-21-2013, 02:01 AM
  6. [SOLVED] Split Time Duration to first complete the running hour and then go to End time
    By joogibabu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2013, 10:56 PM
  7. Calculate finish time given start time, working hours and job duration
    By swanseaexcel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2012, 03:00 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