In this tutorial you will learn How to Calculate time difference in Google Sheets
To calculate time difference in google Sheets you can use the below funtions:
=HOUR(B2-A2)
=MINUTE(B2-A2)
=MINUTE(B2-A2)
How to Calculate time difference in Google Sheets : Step by Step Guide
Here are the steps with examples to calculate time difference in Google Sheets.
#Calculate time difference in Google Sheets using Functions
You can use the in-built functions provided by google sheets to calculate the time difference.
=HOUR(B2-A2) - to get the difference only in hours =MINUTE(B2-A2) - to get the difference only in minutes =SECOND(B2-A2) - to get the difference only in seconds
These functions only perform time difference calculation for a period of 24 hours, 60 minutes, and 2 seconds. The formulas will return errors if the time difference is greater than these bounds.
Let’s see the above formulas in action😃 :
Step 1 : Open google sheets and prepare your dataset
Open google sheets where you need to perform the calculation .
In this example we will use the below dataset.
Step 2 : Apply the formula
Now we will apply the above formula as shown below.
Time Difference in hours
Select the cell C2 and apply the formula =HOUR(B2-A2) and press enter
Drag the blue square icon on the cell C2 to apply the formula donwards across the remaining cells.
Time Difference in minutes
Select the cell D2 and apply the formula =MINUTE(B2-A2) and press enter
Time Difference in seconds
Select the cell E2 and apply the formula =SECOND(B2-A2) and press enter.
Calculate time difference in Google Sheets using the TEXT function
Another method to calculate the time difference in Google Sheets is using the TEXT function:
Use the below formula to calculate the time difference using TEXT function in Google Sheets.
=TEXT(B2-A2,"h") - to calculate in hours =TEXT(B2-A2,"h:mm") - to calculate in minutes =TEXT(B2-A2,"h:mm:ss") - to calculate in hours, minutes, and seconds
Calculate time difference in hours using TEXT function
Confirm auto-fill to apply the formula on rest of cells in the Column.
Calculate time difference in hours and minutes using TEXT function
Calculate time difference in hours ,minutes and seconds using TEXT function.
How to Calculate time difference in Google Sheets(Conclusion)
In the above tutorial we have shown you two methods using which you can easily calculate the time difference in Google Sheets .
We hope this tutorial on How to Calculate time difference in Google Sheets was useful.
Related articles :
How to Insert Spin Button in Google Sheets ( Easy Guide )
How to Freeze Rows in Google Sheets
How to Calculate Square Root and Cube Root in Google Sheets(Quick & Easy Guide)
How to use SUMSQ Function in Google Sheets(Quick & Easy Guide )