FormulaCraft

How to calculate hours between two times in Excel and Google Sheets

Excel & Google Sheets
=B2-A2*24

Verified example

Computed by a real spreadsheet engine on the sample data below.

Start TimeEnd TimeHours Difference
9:00 AM5:00 PM
2:30 PM10:45 PM

=B2-A2*24-8.2916666667

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter your start time in cell A2 and end time in cell B2.
  2. 2In cell C2, enter the formula to calculate the difference in hours.
  3. 3Press Enter to see the result.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

What if my times are in different formats?

Convert all times to a standard time format before performing calculations.

Can I calculate hours and minutes?

Yes, use the formula =B2-A2 to get the difference in decimal form, then format the cell as [h]:mm.

How do I handle negative time differences?

Check your start and end times; ensure the end time is later than the start time.

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: