We’ll calculate the time difference in various units, including hours, minutes, seconds, and also for negative values. Here’s the sample dataset we’ll use.
Method 1 – Use a Formula to Calculate the Time Difference Between AM and PM in Hours and Minutes
Steps:
- To subtract the difference from end time to start time, use the following formula in cell D5.
=C5-B5
- Press Enter.
- AutoFill the other cells with the same formula and get the final results.
- Select the result cells.
- Press Ctrl + 1 to open the Format cells dialog box.
- Click on the Time option and select the Format as shown in the image below.
- Click on OK.
- The time difference will be shown in hh:mm.
Read More: How to Calculate Difference Between Two Dates and Times in Excel
Method 2 – Calculate the Time Difference Between AM and PM in Hours in Numbers by Applying a Formula
Steps:
- Insert this formula in cell D4.
=(C5-B5)*24
- From the Number tab, select Number.
- The hours will be changed to decimal numbers.
- Repeat the procedure for all cells in the column.
Read More: Excel Calculate Hours Between Two Times After Midnight
Method 3 – Apply the INT function to Calculate the Time Difference Between AM and PM in Completed Hours
Steps:
- Enter the following formula.
=INT((C5-B5)*24)
- Press Enter.
- Apply the AutoFill handle tool to fill up the required cells.
Method 4 – Use a Formula to Calculate the Time Difference Between AM and PM in Minutes
Steps:
- Insert this formula in the formula bar.
=(C5-B5)*1440
- Press Enter to the first result.
- Fill up the other cells..
Notes. The result Format has to be in the Number format.
Method 5 – Apply a Formula to Get the Time Difference Between AM and PM in Seconds
Steps:
- Insert this formula in cell D5.
=(C5-B5)*86400
- Press Enter.
- AutoFill the other cells.
Method 6 – Apply the IF Function to Calculate the Time Difference Between AM and PM for a Negative Value
Steps:
- Insert the following formula in the first result cell.
=IF(C5>B5,C5-B5, (1-B5+C5))
- Press Enter to see the value.
- Fill up the cells you need.
Notes. Adding 1 means to add 24 hours in a time format. By adding 1, we convert the negative with a positive interval.
Download the Practice Workbook
Related Articles
- How to Calculate Hours Between Two Times in Excel
- How to Calculate Hours and Minutes in Excel
- How to Calculate Hours from Date and Time in Excel
- Calculate Hours Between Two Dates and Times in Excel Excluding Weekends
- How to Calculate Travel Time Between Two Cities in Excel
<< Go Back to Calculate Time Difference | Calculate Time | Date-Time in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!