If you have worked with date and time in Google Sheets, I am sure you already know how easy it is to add dates to an already existing date in a cell.
For example, if you have the current date in a cell and you add 10 to it, it will give you the date of the day 10 days after the current date.
But what if you want to add time to Google Sheets?
For example, you have the date and time in a cell and you want to know what will be after 4 hours or after 30 minutes.
Again, this can also be done easily in Google Sheets with simple addition formulas.
In this tutorial, I will show you how to add time in Google Sheets (i.e., add hours or minutes or seconds to an already existing date and timestamp)
So let’s get started!
Adding Hours to Date/Time in Google Sheets
Suppose you have the dataset as shown below where you have the timestamp (which includes the date as well as the time) and you want to add the number of hours in column B.
Now, unlike when adding dates, you can not simply add hours to a timestamp in Google Sheets.
You need to make sure that the unit of both the columns in the same. For example, if you add the value 3 to 10:00:00, it will not give you 1 PM (i.e., the value of time after 3 hours).
This is because when you add 3 to the time, it adds 3 days to the time to which it’s added. So when you have to add some hours, you need to make sure the number actually represents hours and not days.
For example, 24 hours would be 1 day, 12 hours would be 0.5 days, as so on.
Hence, when you have the time in hours, you need to divide it by 12 to get the correct value that can be added to a timestamp that has day and time both.
Below is the formula that will give you the correct result when you have added hours in column B with the time in Column A:
In the above formula, I have divided the value in column B with 24 to convert it to hours as that’s what I have in column A as well.
Showing Time in More than 24 Hours Format
In case you add hours where the total is more than 24 hours, you will notice that the result will not show you the overall total number of hours that exceed 24 hours.
Rather, it would show you the time that’s in excess of the 24 hours (as shown in the image below):
In case you want to show the total number of hours, you will have to change the formatting of the cell.
Below are the steps to change the cell formatting so the total number of hours are shown:
- Select the cells for which you want to change the cell format
- Click the Format option in the menu
- Hover the cursor over the Number option
- Go to More formats and the click on Custom number format
- In the Custom number formats dialog box, enter the following format: [hh]:mm:ss
- Click on Apply
The above steps would format the cells so that these will show the hours even when the total is more than 24 hours (as shown below in Column C)
Adding Minutes to Date/Time in Google Sheets
Just like adding time in hours in Google Sheets, you can also add minutes as well.
And again, you need to make sure that the unit of the time in the values being added needs to be the same – which is minutes.
Suppose you have a dataset as shown below and you want to add time in column B to the values in column A.
Below is the formula that will do this:
The above formula converts the value in column B into minutes by dividing it by (24*60)
Adding Seconds to Date/Time in Google Sheets
And again, just like adding hours and minutes, you can also add seconds to the time.
And again, you need to make sure that the unit of the time in the values being added needs to be the same – which is seconds.
Suppose you have a time dataset as shown below and you want to add the seconds in column B to the time in column A.
Below is the formula that will do this:
In the above formula, I have converted the value in Column B into seconds by dividing it by (24*60*60)
Just like we have added time in these examples, you can also subtract time (just change the addition operator with the subtraction operator in the formulas).
So these are the ways you can add time in Google sheets (be it in hours, minutes, or seconds).
I hope you found this tutorial useful!
Other Google Sheets tutorials you may like: