Formula for Summing Elapsed Hours and Minutes in Excel

Last reviewed: November 2, 1994
Article ID: Q66880
The information in this article applies to:
  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.0
  • Microsoft Excel for OS/2, versions 2.2, 2.21, 3.0

SUMMARY

You may want to sum a range of cells containing time values in an "hours:minutes" format that may be greater than 24 hours and also display the result as "hours:minutes." You can do this by using the formulas in the following example:

In cell A1, enter the following

   =SUM(VALUE(RIGHT(TEXT(B1:B5,"hh:mm"),2)))

and use CTRL+SHIFT+ENTER to enter it as an array formula. This returns the total minutes from the "minutes" portion of your range (B1:B5).

In cell A2, enter the following

     =SUM(VALUE(LEFT(TEXT(B1:B5,"hh:mm"),LEN(TEXT(B1:B5,"hh:mm"))-3)))

and use CTRL+SHIFT+ENTER to enter it as an array formula. This returns the total hours from the "hours" portion of your range.

In cell A3, enter the following

   =(A2+INT(A1/60))&":"&TEXT((A1-60*INT(A1/60)),"00")

This returns the total as "hours:minutes."

These formulas work if the values in your range (B1:B5 in this example) are entered as either time or text values, and formatted using the "hh:mm" number format. This works well if you are entering hh:mm values, where an individual entry may be less than 24 hours (such as 2:30), which Excel interprets as a numeric value, or greater than 24 hours (such as 82:45), which Excel would interpret as a text value.

If the range in the example contained the following entries

             B
         ---------
        1|  12:30|
        2|145:23 |
        3|   3:20|
        4|   0:45|
        5|72:55  |

the formulas would return the following:

            A
         ---------
        1|    173|
        2|    232|
        3|234:53 |


KBCategory: kbusage
KBSubcategory:

Additional reference words: 2.0 2.00 2.01 2.1 2.10 2.2 2.20 2.21 3.0
3.00 4.0 4.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.