Difference Between Two Times in Hours Using Google Sheets

You can find the total hours between a start and end time in Google Sheets in several ways. We’ll cover the two easiest.

Preparation – Properly Format Your Dates

Before you use the formulas in this tutorial, ensure your times are valid data types. There are several formats; choose the one that works best for you.

List of valid date/times
Valid Dates

You can use the ISDATE function to check each date as shown above.

Calculations – Find the Difference Between Two Times in Hours

Once your data is ready, you can use either of these easy formulas to find the hours. Each technique has different advantages.

Time duration in hours
Duration in Hours

First formula: =ROUND((B2-A2)*24)

The most simple formula simple subtracts the starting time from the ending time. When you subtract two times in Google Sheets, the result is the number of days between them. Since you are looking for hours instead of days, multiply this difference by 24. Multiplying the difference by 24 converts the time units from days to hours since there are 24 hours each day.

The ROUND function uses the standard rounding rules. Consider using ROUNDDOWN for whole hours.

Second formula: =TEXT(B3-A3,"[H]")&" hours")

This next formula converts the result to a text string using the TEXT function. Using a text string allows you to add the unit to the end of the result to make it clear to the spreadsheet reader. So, as seen in the image above, the result is shown as 22 hours instead of just 22.00.

⚠️ Be sure to add the square brackets around the [H] if calculating a longer duration. These brackets change the format from a point in time to a duration. This allows the hours to exceed 24. In this example, the result will be the same because the result is only 22 hours.

Practice – Get a Copy of the Template

Make a copy of this template to see the examples in a live Google Sheet.

Advanced – Use TIMEDIF for Other Time Units

If you want a more complex output, such as years, weeks, or months, consider using the TIMEDIF add-on.

Related Tutorials