Formulas - 2026-05-12
Excel Time Formulas: Complete Guide
Learn Excel time formulas for hours worked, time differences, overtime, adding hours, formatting durations, and common time calculation errors.
How Excel Time Works
- Excel stores time as a fraction of a day. For example, 12:00 PM is 0.5 because it is half of a day. This makes time calculations possible, but formatting matters.
Calculate Time Difference
- If start time is in A2 and end time is in B2: \\\ =B2-A2 \\\ Format the result as time or duration.
Calculate Hours Worked
- \\\ =(B2-A2)*24 \\\ Multiplying by 24 converts the time difference to decimal hours.
Handle Overnight Shifts
- \\\ =MOD(B2-A2,1) \\\ This works when the end time is after midnight.
Add Hours to a Time
- \\\ =A2+TIME(2,0,0) \\\ This adds two hours to the time in A2.
Related Guides
- TIME function HOUR function MINUTE function Excel Date Formulas
Formula debugging workflow
- Step Action 1 Select the cell and read the formula in the formula bar 2 Use Formulas → Evaluate Formula for nested functions 3 Check for text stored as numbers (green triangle) 4 Fix errors using our formula error guide Go deeper: Compare similar functions · Fix common problems
Frequently asked questions
- How do I calculate hours worked in Excel? Use =(end_time-start_time)*24 and format the result as a number.
- How do I calculate overnight hours in Excel? Use =MOD(end_time-start_time,1) to handle shifts that pass midnight.
- Why does my formula show an error? Open the linked error pages (#N/A, #VALUE!, #REF!) from our directory. Most formula posts fail because of data type mismatches, deleted references, or wrong match modes — not because the function name is wrong.
- Should I copy formulas down or use a Table? Copying down is fine for one-off models. Convert the range to an Excel Table when you add rows often — structured references stay readable and break less.