Excel/calculating time


Good morning Tom, I have 100's of start-stop times in a worksheet denoting punch in and out times of my work day.  These punches include a punch in for beginning of day, out punch for lunch, in punch for end of lunch and out punch for the end of the day.  These punches are by the minute.  Calculating my actual worked hours for the day is proving difficult (my fingers are getting tired, kidding).  Is there a function/formula to calculate the actual hours for the morning worked and the afternoon worked?  I am currently using military time, however switching will not be a problem.  I am not familiar with changing time to "serial" numbers??? if this is the solution.  Thank you for any help you may be able to provide.


a2:  time in
b2:  time out to lunch
c2:  time in from lunch
d2:  time out

e2:  =(B2-A2)+(D2-C2)   format as time

time is stored as a fraction of a 24 hour day.  so 6 AM is .25; noon is .5

so you just have to subtract the start time from the end time.  

All this assumes you actually enter you values at time values.  If I enter

13:40  in a cell, it should be stored as 0.569444444444444    you shouldn't have to change time to  "serial" numbers.  Excel should do that automatically.

If that isn't happening, then the answer to your question would be dependent on how your data is stored.  (I have assumed that you are working with normal work hours such as 8 to 5.  

If your data isn't be stored as actual excel times, then you can send me a sample worksheet and I am willing to take a look.

Send to twogilvy@msn.com

Tom Ogilvy

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2017 About.com. All rights reserved.