How to Calculate Time Difference Between AM and PM in Excel (6 Ways)

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

Use Formula to Calculate Time Difference Between AM and PM in Hours and Minutes

  • Press Enter.

Use Formula to Calculate Time Difference Between AM and PM in Hours and Minutes

  • AutoFill the other cells with the same formula and get the final results.

Use Formula to Calculate Time Difference Between AM and PM in Hours and Minutes

  • 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.

Use Formula to Calculate Time Difference Between AM and PM in Hours and Minutes

  • The time difference will be shown in hh:mm.

Use Formula to Calculate Time Difference Between AM and PM in Hours and Minutes

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

Calculate Time Difference Between AM and PM in Hours in Numbers Applying Formula

  • From the Number tab, select Number.

Calculate Time Difference Between AM and PM in Hours in Numbers Applying Formula

  • The hours will be changed to decimal numbers.

Calculate Time Difference Between AM and PM in Hours in Numbers Applying Formula

  • Repeat the procedure for all cells in the column.

Calculate Time Difference Between AM and PM in Hours in Numbers Applying Formula

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)

Apply the INT function to Calculate Time Difference Between AM and PM in Completed Hours

  • Press Enter.

Apply the INT function to Calculate Time Difference Between AM and PM in Completed Hours

  • Apply the AutoFill handle tool to fill up the required cells.

Apply the INT function to Calculate Time Difference Between AM and PM in Completed Hours


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

Use Formula to Calculate Time Difference Between AM and PM in Minutes

  • Press Enter to the first result.

Use Formula to Calculate Time Difference Between AM and PM in Minutes

  • Fill up the other cells..

Use Formula to Calculate Time Difference Between AM and PM in Minutes

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

Use Formula

  • Press Enter.

Use Formula

  • AutoFill the other cells.

Use Formula


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))

Use Formula

  • Press Enter to see the value.

Use Formula

  • Fill up the cells you need.

Use Formula

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


<< Go Back to Calculate Time Difference | Calculate Time | Date-Time in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Bhubon Costa
Bhubon Costa

Bhubon Costa, B.Sc. in Naval Architecture & Marine Engineering from Bangladesh University of Engineering & Technology, has worked with the ExcelDemy since 2021. Currently, he has been working as a reviewer. Notably, he has written over 90 articles and led several VBA content development teams. He has a great passion for the fields of data analytics and data science. His areas of expertise include Excel VBA, Power Query, Pivot Table, Power BI, MySQL, PostgreSQL, machine learning, and Python... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo