Google Sheets function · Date
HOUR in Google Sheets: syntax and examples
HOUR reads the hour from a time, a datetime or a decimal fraction of a day and returns a whole number from 0 to 23. Use it to group timestamps by hour of the day.
Syntax
HOUR(time)
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
time | time | yes | A time value, a decimal fraction of a day or a text time. Only the hour, 0 to 23, is returned. |
Examples
The examples use this table, starting in A1:
| Value | Datetime |
| 0.5 | 46096.9 |
| 0.75 | 46096 |
=HOUR(A3)Result: 18
A cell holding 0.75, which is three quarters of a day: 18:00, so HOUR returns 18.
Run in a Google Sheet (English US locale) on .
=HOUR(TIME(9, 45, 0))Result: 9
Hour of a time built with TIME: the minutes do not change the result.
Run in a Google Sheet (English US locale) on .
=HOUR(B2)Result: 21
A date with time. 46096.9 is 15 March 2026 at 21:36, and the date part is dropped.
Run in a Google Sheet (English US locale) on .
=HOUR("14:30:00")Result: 14
A text time is parsed first. The hour is 14.
Run in a Google Sheet (English US locale) on .
=HOUR(A2)Result: 12
Half a day is noon, so the hour is 12.
Run in a Google Sheet (English US locale) on .
Common errors
- Minutes and seconds are cut off, never rounded up. HOUR(TIME(9, 59, 59)) is 9.
- A whole-day serial with no fraction, such as 46096, has no time of day, so HOUR gives 0.
- Text that is not a time returns #VALUE!. A plain number is read as days, so a cell with 0.75 gives 18, not 0.75.
Compared with Excel
Same syntax in Excel, with the same 0 to 23 range.