How to Convert Time to Decimal in Google Sheets (2023 Update)

In this article we will show you how to convert time to decimal in Google Sheets in just a few clicks. Simply follow the steps below:

Convert Time to Decimal Google Sheets

Time to decimal sample sheet 


The formula uses a combination of the HOUR, MINUTE, and SECOND functions:

=HOUR(time)+(MINUTE(time)/60) + (SECOND(time)/3600)

Where time is the cell containing the time to convert to decimal.

It will separate the hour, minute, and the second value from the time and then convert the minute and second to its corresponding decimal forms relative to the hour. 3600 is the number of seconds in 1 hour. The resulting decimal will be in hours.

Below are the steps to use this formula.

1. Identify the Cell where The Time Value is Located

For our example, we have a sheet containing a set of timestamps in Column A. We want to convert them to time in hours, with minutes and seconds converted to decimals.

convert time to decimal google sheets, input data in sheet

For Row 2, we have the time stored in cell A2 and we want to insert the formula to B2.

2. Use Formula =HOUR(time)+(MINUTE(time)/60) + (SECOND(time)/3600)

For Row 2, the time to convert is stored in cell A2. The formula becomes

=HOUR(A2)+(MINUTE(A2)/60) + (SECOND(A2)/3600)

You can insert this to B2.

google sheets convert time to decimal, insert formula

Alternatively, you can type the formula by itself, clicking the cell A2 in the process, but it can take more time.

3. Press Enter 

We now have the time converted to decimals!

convert time to decimal google sheets output

If it is the first time you insert this formula, Google Sheets will do something. Check the next step.

4. Autofill to Other Rows

If it is the first time you have inserted this formula, Google Sheets will suggest auto filling other rows with timestamps as well. Click the check mark. 

Formula to convert time to decimal in google sheets autofill suggestion

The formula has been applied to all other rows.

Formula to convert time to decimal in google sheets extended to other rows

You can also change the number of decimals by selecting the range, then clicking the Decrease decimal places icon along the main toolbar. 

For our example we will click the icon a few times to reduce the number of decimals to two:

google sheets how to convert time to decimal adjust number of decimal places


How do you Convert Decimal to Time in Google Sheets?

If instead you are given the number of hours with decimals, you can convert the decimals to minutes and seconds. Follow the steps above, but this time using the formula below:

=time(int(input), int((mod(input,1))*60), int((mod((mod(input,1))*60,1))*60))

This formula is lengthy. It has three parts:

int(input) isolates the hour

int((mod(input,1))*60) converts the decimal and isolates the minutes

int((mod((mod(input,1))*60,1))*60)) converts the decimal of minutes and isolate the seconds

And then combined using the TIME function. You can see this in action below.

google sheets how to convert decimal to time

Lido is a new spreadsheet built for automation. Trigger emails, slack messages, and more directly from a spreadsheet.