Category: FUNCTION | Updated: 2026-11-22
How to Use the HOUR Function in Google Sheets | Extract the Hour from a Time
How to Use the HOUR Function
The HOUR function extracts the hour component of a specified time value as an integer from 0 to 23. It is helpful for grouping attendance logs by time of day or analyzing timestamps.
Syntax
=HOUR(time)
- time: A cell reference containing a time value, a formula such as
TIME, or a serial number from which to extract the hour.
Examples
With time values in Column A, entering HOUR in Column B extracts only the numeric hour.
| A (Target Time) | B (Formula) | Result | Notes |
|---|---|---|---|
| 09:15:00 | =HOUR(A2) |
9 | Extracts 9 from morning time |
| 14:45:30 | =HOUR(A3) |
14 | Extracts 14 in 24-hour format |
| 2026/11/22 18:20:00 | =HOUR(A4) |
18 | Extracts only the time portion from a date-time value |
| 0.75 | =HOUR(A5) |
18 | Extracts 18 from serial value 0.75 (18:00) |
Common Errors and Tips
- Handling durations over 24 hours: Because
HOURalways returns the hour of the day (0–23), a duration like26:00:00returns2. To extract total hours from worked time, multiply the serial value by 24 and take the integer part:=INT(A2*24). #VALUE!error: Occurs when the argument is a text string that cannot be parsed as a valid time (such as"2:30 PM"written in an unsupported format or with full-width digits).#NUM!error: Occurs when a negative number (negative serial value) is passed as the argument.
Frequently Asked Questions
Q. What happens if I use HOUR on a cumulative duration of 24 hours or more?
A. HOUR returns the hour of the day from 0 to 23 (like a clock face), so 25 hours 30 minutes returns "1". To get total cumulative hours, use "=INT(cell*24)".
Q. Does HOUR work on times entered as text strings?
A. If the string is in a format Google Sheets recognizes as a time (such as "14:30"), it is converted automatically. Full-width characters or unrecognized formats return a #VALUE! error.