The Google Sheets TIME function converts a given hour, minute, and second into a time value. Its syntax is TIME(hour, minute, second), and it returns a decimal that Google Sheets displays as a time (for example, TIME(14, 30, 0) returns 2:30 PM).
What the TIME Function Does
In Google Sheets, dates and times are stored as numbers. A whole number represents a day (1 = January 1, 1900), and the fractional part represents the time of day. The TIME function builds that fractional part from three separate numbers you provide. This is useful when you have hour, minute, and second values in separate cells and need to combine them into a single time value that can be used in calculations, sorting, or formatting.
For example, if cell A1 contains 14, B1 contains 30, and C1 contains 0, then TIME(A1, B1, C1) returns 0.6041666667, which displays as 2:30:00 PM. The function automatically handles values outside the normal ranges: hours greater than 23 roll over into days, minutes and seconds greater than 59 carry over, and negative values subtract. For instance, TIME(25, 0, 0) returns 1:00 AM (one day plus one hour), and TIME(0, 90, 0) returns 1:30 AM.
How to Use TIME in a Formula
You can type the numbers directly into the function or reference cells. The basic pattern is:
=TIME(hour, minute, second)
Here is a step-by-step example:
- In cell A1, enter
9(hour). - In cell B1, enter
45(minute). - In cell C1, enter
0(second). - In cell D1, enter
=TIME(A1, B1, C1).
Cell D1 will display 9:45:00 AM. If you want to see the raw decimal, change the cell format to Number (Format > Number > Number). The result is 0.40625, because 9:45 AM is 40.625% of a 24-hour day.
Formatting the Result
By default, the TIME function returns a value formatted as a time. You can change how it displays using Format > Number > Time or Custom date and time. For example, to show only hours and minutes, choose Format > Number > Custom date and time and select Hour and Minute. The underlying value remains the same, so you can still perform arithmetic on it.
If you want to display a time as text (for example, “14:30”), you can use the TEXT function: =TEXT(TIME(14, 30, 0), "HH:MM"). Note that TEXT returns a text string, not a time value, so you cannot use it in time calculations directly.
Common Use Cases and Examples
The TIME function is often used to build times from separate components, or to calculate elapsed time. Here are a few practical examples:
- Combine separate time parts: If you have start hour in A1, start minute in B1, and start second in C1, use
=TIME(A1, B1, C1)to get a usable time value. - Add a duration: To add 2 hours and 30 minutes to a time in cell A1, use
=A1 + TIME(2, 30, 0). For example, if A1 is 10:00 AM, the result is 12:30 PM. - Calculate time difference: Subtract one TIME result from another. If start time is in A1 and end time in B1,
=B1 - A1returns the elapsed time as a fraction of a day. Multiply by 24 to get hours as a decimal:=(B1 - A1) * 24. - Create a timestamp: Combine the current date and a specific time:
=TODAY() + TIME(9, 0, 0)gives today at 9:00 AM.
Remember that time values are fractions of a day, so adding 1 to a time value adds 24 hours. To add hours, use TIME(hours, 0, 0) as shown above.
Differences from Excel
Google Sheets’ TIME function works the same way as Excel’s TIME function. The syntax is identical. The main difference is in how you access the function: in Google Sheets, you type it directly into a cell or use Insert > Function > Date > TIME. In Excel, you would find it under the Date & Time category in the Function Library. Another subtle difference: Google Sheets handles negative time values differently. If you subtract a later time from an earlier time, Google Sheets may display a negative time as a negative decimal (for example, -0.25 for -6:00), whereas Excel may show a series of ##### unless you change the date system. For most users, the behavior is similar enough that formulas written in one will work in the other.
Common Errors and Troubleshooting
Here are some issues you might encounter with TIME and how to solve them:
- #VALUE! error: This occurs if any argument is not a number. Check that the cells referenced contain numbers, not text.
- Unexpected time after adding: If you add
TIME(24, 0, 0)to a time, you get the same time next day. If you only want the time of day, use=MOD(time + TIME(24,0,0), 1). - Time shows as a decimal: If the cell is formatted as a number, you’ll see 0.25 instead of 6:00 AM. Change the format to Time.
- Negative time results: If you subtract a later time from an earlier time, you may get a negative decimal. To display it as a negative time, use a custom format like
-h:mm(Format > Number > Custom date and time).
Frequently Asked Questions
How do I convert a time string like “14:30” into a time value?
Use the TIMEVALUE function: =TIMEVALUE("14:30") returns the time value. If the string includes a date, use DATEVALUE or split it with SPLIT.
Can I use TIME to create a time from decimal hours, like 8.5 for 8:30?
Yes. For 8.5 hours, use =TIME(INT(8.5), MOD(8.5, 1) * 60, 0). This extracts the whole hours (8) and converts the fractional part (0.5) to minutes (30).
Why does TIME(0, 0, 0) return 12:00 AM?
Because 0 hours, 0 minutes, and 0 seconds is midnight, which is the start of the day. Google Sheets displays it as 12:00 AM.
How do I add 1 hour and 15 minutes to a time in a cell?
Use =A1 + TIME(1, 15, 0). If A1 contains 3:00 PM, the result is 4:15 PM.
Is there a way to get the current time with TIME?
No, TIME requires you to specify the hour, minute, and second. To get the current time, use the NOW function (which includes the date) or the TIMEVALUE of NOW: =TIMEVALUE(NOW()).
Conclusion
The TIME function is a simple but essential tool for working with times in Google Sheets. It lets you build time values from components, perform arithmetic, and integrate with other date and time functions. Once you understand that times are just fractions of a day, you can use TIME confidently in your spreadsheets.
Related
- Quarterly Balance Sheet Template: How to Build One
- How to Use a Casio Calculator: Step-by-Step Guide
- Balance Sheet ChatGPT: How to Use AI for Financial Statements
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Data Entry Job Information: Work, Pay & SafetyData entry jobs involve transferring information from one format to another—typing text, numbers, or codes into databases, spreadsheets,…
- Resource List Excel Template: Set Up, Track, and ShareA resource list Excel template is a worksheet for recording what resources are available, where they are, who…
- Select an Entire Row in Excel With Shift+SpaceTo select an entire row in Excel, click any cell in that row and press Shift+Space on Windows.…
- Compare Data Between Two Excel Sheets: Methods That WorkTo compare two Excel sheets, use a direct cell-by-cell formula when rows line up, or match records by…
- 3-Way Forecast Excel Template: 3 Models to CompareA three-way forecast Excel template links a projected income statement, balance sheet, and cash flow statement so changes…
- Freeze Cells in Excel While Scrolling: A Step-by-Step GuideTo keep headings visible while you scroll in Excel, select the cell below the rows and to the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.