+ Reply to Thread
Results 1 to 11 of 11

Average hhhh:mm:ss

  1. #1
    Registered User
    Join Date
    12-12-2013
    Location
    Little Rock, AR
    MS-Off Ver
    Excel 2003
    Posts
    15

    Average hhhh:mm:ss

    I have a spreadsheet with times in it (hhhh:mm:ss format). I need to average the times, and can't find a formula to work. It might be because the cells are general formatted as this is how it comes out of the database that the information is extracted from. Is there a quick formula that would help me calculate the average time? I can attach a sample file if this would be useful.....

  2. #2
    Registered User
    Join Date
    12-12-2013
    Location
    Little Rock, AR
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Average hhhh:mm:ss

    TIME.xlsxHere is the attachment if needed.... thanks in advance.

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

    Re: Average hhhh:mm:ss

    You can't get a average because the cells contain text and not time values
    You cannot use hhhh:mm:ss as a time format
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Average hhhh:mm:ss

    =sumproduct(--(right(a2:a25,8)))/24
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Average hhhh:mm:ss

    In fact you do not have real times but text looking like time. Try
    Please Login or Register  to view this content.
    . The first part transforms each cell into real time and adds them all up. Then it is divided by the number of non-empty cells.

  6. #6
    Registered User
    Join Date
    12-12-2013
    Location
    Little Rock, AR
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Average hhhh:mm:ss

    I understand that it is in text format instead of numerical, and that definitely throws a wrench in the gears. Maybe there is a formula that I could put into Column B that would convert the text format in Column A to numerical in Column B? I know that I could just type the seconds in numerical format, but that would be very time intensive as I have over 1,000 rows of data. Plus, the number of rows will periodically change. Maybe there isn't a way to do what I want to do, but it never hurts to ask.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Average hhhh:mm:ss

    Have you tried solutions provided in thread #4 and 5 ? They both do the job as far as I can tell

  8. #8
    Registered User
    Join Date
    12-12-2013
    Location
    Little Rock, AR
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Average hhhh:mm:ss

    Yes, I made a mistake in my calculations. Thanks everyone.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Average hhhh:mm:ss

    you could make it a bit more dynamic i suppose with hhhh:mm:ss in a1 then those time stamps in a2 down
    =SUMPRODUCT(--(RIGHT(A2:INDEX(A:A,COUNTA(A:A)),8)))/(COUNTA(A:A)-1)

  10. #10
    Registered User
    Join Date
    12-12-2013
    Location
    Little Rock, AR
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Average hhhh:mm:ss

    Thanks for all of the great suggestions. Though I have marked this as solved, I do have one last question..... I've noticed that the average changes when I change the 8 in the above formula to a lower number..... the numbers in my case will never exceed 1:23 places.... when I have only data in the seconds place (000:00:ss), I can change the 8 to a 2, and the calculations are dead on... however, if I change the 8 to a 4, the average is calculated as a lower number...... Why does this happen? I know 3 vs. 8 would mean the colon ( place, so I figure that I would be safe to set the 8 to 4, but it throws the calculations off. Any ideas?

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Average hhhh:mm:ss

    you need 8 so that hh:mm:ss is returned
    00:00:34 ie 34 seconds
    if you use 4 it assumes that its h:mm
    0:34 is 0 hrs 34 mins
    both these need cell formatted as time
    or multiply result by 86400 to get result in seconds cell format general
    2 would just produce numbers which you average cell format general
    btw your actual result for those posted isnt 00:00:42 its actually 00:00:41.5
    if you multiply
    0.000480324*86400 = 41.5
    Attached Files Attached Files
    Last edited by martindwilson; 12-13-2013 at 04:51 PM.

+ 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] Find Average, Return Column Header of Number Closest To Average
    By djmyers in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-07-2013, 04:19 PM
  2. Replies: 14
    Last Post: 06-14-2013, 09:00 PM
  3. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM
  4. Replies: 5
    Last Post: 06-19-2012, 04:37 PM
  5. [SOLVED] Convert hhhh:mm:ss to hh:mm:ss (macro ?)
    By BT Bill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-08-2005, 05:07 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