How to calculate elapsed time in Excel

Mastering Elapsed Time in Excel: The Ultimate Office Tutorial (2026)

Elapsed Time in Excel Formula

The definitive tutorial for project managers, payroll specialists, and office administrators.

Excel Formulas Giving You Errors?

Skip the complex formatting and get an instant duration result.

Use Pro Time Tool →

The Excel Time Paradox

Calculating the time between two events seems like it should be simple addition or subtraction. However, Excel treats time as a fraction of a day (where 1 = 24 hours). This hidden logic is why many office workers see nonsensical numbers like “0.25” when they expect to see “6 hours.”

In this pillar guide, we will break down the exact formulas and custom formatting required to calculate elapsed time (durations) accurately, whether you are tracking employee shifts, project timelines, or server uptime.

1. The Core Formula: End Time Minus Start Time

The golden rule of time calculation in Excel is: End Time – Start Time. If your start time is in cell A2 and your end time is in B2, your formula is simply:

=B2-A2

The Formatting Catch

By default, Excel might display the result as a specific time of day (e.g., 6:00 AM) rather than a duration (6 hours). To fix this, you must change the Number Format:

  • Right-click the cell and select Format Cells.
  • Go to the Number tab and select Time.
  • Choose the format 13:30 or 37:30:55 for durations.
Calculating Payroll Hours?

Convert Excel time directly into decimals for easy pay calculation.

Decimal Converter Tool →

2. Handling Over-Midnight Shifts

If an employee starts at 10:00 PM and finishes at 6:00 AM, the simple =B2-A2 formula will return a “#####” error or a negative number because Excel thinks the end time is “before” the start time on the same day.

The MOD Formula Solution

To handle shifts that cross the midnight barrier, use the MOD function. This tells Excel to ignore the negative result and treat the day as a 24-hour cycle:

=MOD(B2-A2, 1)

This is the most reliable formula for office timesheets where overnight work is common.

3. Calculating Totals Beyond 24 Hours

If you sum a column of durations that add up to 30 hours, Excel will often show “6:00.” This is because it “wraps” around 24 hours (30 – 24 = 6). To display the actual cumulative total, you must use Custom Formatting:

  1. Select your Total cell.
  2. Press Ctrl + 1 (Format Cells).
  3. Select Custom.
  4. In the “Type” box, enter: [h]:mm:ss

The square brackets [h] tell Excel to “stop resetting at 24” and show the total hours instead.

Totaling Weekly Hours?

Easily add hours and minutes without fighting Excel’s formatting.

Add Time Now →

4. Essential Formula Reference Table

Goal Excel Formula
Simple Duration=B2-A2
Across Midnight=MOD(B2-A2, 1)
Difference in Minutes=(B2-A2)*1440
Difference in Seconds=(B2-A2)*86400
Convert Time to Decimal=(B2-A2)*24

5. Frequently Asked Questions (Office FAQ)

Why is my Excel time result showing 0.00?

Your cell is likely formatted as a “Number” or “Currency.” Change the format to “Time” or “Custom” [h]:mm to see the actual hours.

How do I subtract 30 minutes for a lunch break?

Use the formula =B2-A2-(30/1440). Since Excel treats a day as 1, you must divide minutes by 1440 (the minutes in a day).

Can Excel calculate the number of days between dates?

Yes. Simply subtract the date cells: =End_Date – Start_Date and format as a Number.

Why does Excel show “####” in my time cell?

This usually happens when the result is a negative time (unsupported by default) or the cell is too narrow to show the data.

How do I calculate age from a birthdate in Excel?

Use =DATEDIF(Birth_Date, TODAY(), “y”) to get the age in years.

How to convert 24-hour time to AM/PM?

Simply change the cell format to h:mm AM/PM. The underlying data stays the same.

Need a Precise Age Calculation?

Don’t trust Excel’s DATEDIF? Use our clinical-grade tool.

Exact Age Calculator →

6. Conclusion: Precision Matters

Excel is a powerful tool, but its handling of time is a common point of frustration for office workers. By mastering the MOD function and the [h] formatting tag, you can eliminate 90% of the errors in your reports. However, for complex payroll or duration checks, using a dedicated web-based calculator provides an essential “second opinion” to ensure your data is 100% accurate.

© 2026 Calculator Online Pro
Empowering office professionals with accurate, simple, and professional calculation tools.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top