Adding whole hours or decimal hours to a given time in Google Sheets is a fairly simple process. You can do this by using the Start_time+TIME(hours,0,0) and Start_time+hours/24 functions. In this add hours to time guide, we will show you how to do this.
Table of Contents
Adding whole hours
If you want to add whole hours to a given time, you can use the following formula:
=Start_time+TIME(hours,0,0)
Start_time
: the time that you want to add hours toHours
: the hours that you wish to add
This function returns a time formatted string.
Cell C2 shows the number of hours you want to add, while Cell D2 displays a formula that will calculate how many more cells need changing.
=B2+TIME(C2,0,0)
Or
=B4+C4/24
To see the result, press Enter key.
Explanation
The TIME function is a great way to convert decimal numbers into an appropriate time format. Here, we change the number of hours from 5 (which converts it into PM) and then add:00 before adding another set amount for minutes-in, in this case, 0 because there aren’t any other digits available on our keyboard!
Note: To subtract the hours from a time period, you need to use this formula.
= MOD(Start_time-TIME(hours,0,0),1)
For Instance, Cell B2 shows time, and cell C2 shows the number of houses you want to subtract. If you want to subtract a number of hours, use the below formula:
=MOD(B2-TIME(C2,0,0),1)
To see the result, hit Enter key.
The MOD (modulus) function is an important tool for financial professionals. It can be used to flip negative numbers into positive ones yield accurate results in most cases!
Add decimal hours to time
Generic formula:
=Start_time+hours/24
- Start_time: the time that you wish to add hours to.
- Hours: the hours that you wish to add to start_time.
The value should be returned in time format.
For instance, cell B2 contains the time value, and cell C9 displays the number of hours you want to add. Please see the below formula for this purpose.
=B2+C2/24
To see the result hit Enter key.
24 hours in a day, and one hour is 1/24th of the whole duration.
Note: Subtracting the hours from time is easy with this formula.
=MOD(Start_time-hours/24,1)
The number of hours you want to subtract is displayed in cell C2, and time is displayed in B2. To find the correct formula, please use this simple equation:
=MOD(B2-C2/24,1)
To see the result hit Enter key.
When google sheets detects negative values in a cell, it converts them to positive with the MOD function. This means you can just flip your negatives around and get an accurate time reflecting how long something takes!
Note:
- The number of hours when using the Start_time + hours / 24 formula can be a decimal number. See screenshot:
2. If the result is over 24 hours, then under the Formate cell’s Number tab, go to the Custom section and format the result as [h]:mm:ss.
Related Functions
- Google Sheets TIME function
The Google Sheets TIME function returns a date in serial number format for a particular time (the hour, minute and second).The syntax of the TIME function is as below:= TIME(hour, minute, second)… - Google Sheets MOD function
the Google Sheets MOD function returns the remainder of two numbers after division. So you can use the MOD function to get the remainder after a number is divided by a divisor in Excel. The syntax of the MOD function is as below:=MOD (number, divisor)….