How to Calculate Time Difference in Excel: A Step-by-Step Guide

Calculating the time difference in Excel is pretty straightforward. You use simple formulas to subtract one time value from another, and Excel will handle the rest. In a few easy steps, you’ll be able to determine how much time has passed between two events. Ready to give it a try? Let’s dive in!

Step-by-Step Tutorial on Calculating Time Difference in Excel

In this tutorial, you’ll learn how to calculate the time difference between two cells containing time values in Excel. Follow these steps to get accurate results quickly.

Step 1: Open Excel and Enter Time Values

Start by opening Excel and entering the start and end times in two separate cells.

For instance, you might enter 8:00 AM in cell A1 and 5:00 PM in cell B1. Make sure you format these cells as time values so that Excel recognizes them correctly.

Step 2: Use the Subtraction Formula

In a new cell, use a basic subtraction formula to find the difference.

Type =B1-A1 in cell C1. This formula will subtract the start time in A1 from the end time in B1.

Step 3: Format the Result Cell

Apply a time format to the result cell to see the difference in hours and minutes.

Right-click on cell C1, select "Format Cells," choose "Time" from the list, and select the format you prefer.

Step 4: Adjust for Negative Results (if needed)

If your end time is before your start time, the result might be negative. Adjust the formula to avoid this.

Use the formula =IF(B1<A1, B1+1-A1, B1-A1) in cell C1. This will add a day to the end time if it’s earlier than the start time, ensuring a positive result.

Step 5: Verify Your Results

Double-check your entries and calculations to make sure everything is correct.

Look at the result in cell C1 to confirm the time difference. If everything is formatted correctly, you should see the duration between your start and end times.

Once you complete these steps, you’ll be able to see the calculated time difference in hours and minutes. You can apply these steps to any set of time values in Excel.

Tips for Calculating Time Difference in Excel

  • Use 24-hour time format to avoid confusion between AM and PM.
  • Double-check cell formats to ensure they are set to "Time".
  • If calculating time differences over multiple days, include the date in your cells.
  • Use conditional formatting to highlight negative results.
  • Experiment with different time formats to display the result in a way that suits your needs.

Frequently Asked Questions

How do I calculate the time difference in hours?

To calculate the time difference in hours, use the formula =(B1-A1)*24. This converts the time difference to hours.

How do I handle time differences over multiple days?

Include both date and time in your cells, and use the formula =B1-A1 to calculate the total time difference, which will span multiple days.

What if my result is negative?

Adjust your formula to =IF(B1<A1, B1+1-A1, B1-A1) to add a day if the end time is earlier than the start time.

Can I use Excel's built-in functions for this?

Yes, you can use the DATEDIF function to calculate the difference in days, hours, or minutes, depending on your needs.

How do I format cells for time?

Right-click the cell, choose "Format Cells," select "Time," and pick a format that displays time as you prefer.


  1. Open Excel and enter time values.
  2. Use the subtraction formula.
  3. Format the result cell.
  4. Adjust for negative results if needed.
  5. Verify your results.


Calculating the time difference in Excel doesn’t have to be a headache. By following the steps outlined above, you can easily subtract one time value from another to find out how much time has elapsed. Whether you’re tracking work hours, project durations, or any other timed events, these steps will help you get accurate results.

So, the next time you need to calculate time differences in Excel, you’ll know exactly what to do. If you want to dig deeper, there are plenty of additional resources and tutorials available online that can help you master Excel’s time functions even further. Happy calculating!

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy