Syntax
| Parameter | Description |
|---|---|
| serial_number | Parameter of the HOUR function. |
Examples
Get hour from time
=HOUR("2:30 PM")
Classify by time of day
=IF(HOUR(A1)<12, "Morning", IF(HOUR(A1)<17, "Afternoon", "Evening"))
Extract from datetime
=HOUR("2026-04-09 15:45:00")
Common Errors
Occurs when the argument is text that cannot be interpreted as a time or datetime value.
Tips
HOUR always returns in 24-hour format. 12:00 AM = 0, 12:00 PM = 12, 11:00 PM = 23. There is no AM/PM variant.
Use HOUR, MINUTE, and SECOND together to decompose any time value into its components for custom formatting or arithmetic.
=HOUR(A1) as a pivot field or SUMIFS criteria groups data by hour of day. Great for analyzing peak hours in transaction data.
Try HOUR in Viztab
Import your data and use HOUR with 370+ other formulas. No signup required.
Open Viztab