HOUR in Excel: Extract Clock Hours Without Confusing Duration
Extract Excel hour components, compare 24-hour boundaries and build explicit time-of-day categories while preserving elapsed-hour calculations.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: HOUR returns the hour component of a time as an integer from 0 to 23. It does not return total elapsed hours in a multi-day duration, and it does not round a late-hour time up to the next hour.
Availability and version history
- Introduced: first introduction version is not established by the official history reviewed; the current product list is not a launch record.
- Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official HOUR reference. Documentation and independently modeled examples; no native Excel execution or broader platform certification.
Syntax and output
=HOUR(serial_number)
The required input supplies a time, through a numeric serial, a recognized text string or another formula. Microsoft documents time fractions and recognized time text; the worked controls primarily use numeric TIME and DATE constructions to avoid ambiguous regional parsing.
Format the result as General or Number. HOUR returns a component index such as 18, not a time fraction that should itself be displayed as 18:00.
Example 1: inspect ordinary clock boundaries
=HOUR(TIME(0,0,0))
=HOUR(TIME(8,45,0))
=HOUR(TIME(12,0,0))
=HOUR(TIME(23,59,59))
Expected results are 0, 8, 12 and 23. Midnight is zero and noon is twelve. The final time remains in hour 23 even though it is close to midnight.
A value displayed as 8:45 PM has hour component 20, not 8. A 12-hour display does not change the documented 0–23 numbering. Use =HOUR(TIME(20,45,0)) as the explicit numeric control for that case.
Example 2: a complete date does not change its hour component
=HOUR(DATE(2026,10,14)+TIME(8,45,0))
=HOUR(DATE(2026,10,15)+TIME(8,45,0))
=HOUR(DATE(2026,10,14))
Expected results are 8, 8 and 0. The first two timestamps occur on different dates but share the same clock hour. A date with no supplied time is at midnight for this component check.
HOUR therefore cannot identify a unique event time. Keep the date and other components when the distinction between separate days matters.
Advanced example: classify times into explicit hour bands
Enter numeric times in A2:A7 using TIME: 05:59, 06:00, 11:59, 12:00, 17:59 and 18:00. In B2 enter and fill down:
=IF(HOUR(A2)<6,"Early",IF(HOUR(A2)<12,"Morning",IF(HOUR(A2)<18,"Afternoon","Evening")))
Expected labels are Early, Morning, Morning, Afternoon, Afternoon and Evening. The boundaries are explicitly at 06:00, 12:00 and 18:00; they are this report’s definitions, not universal definitions of parts of a day.
Because every boundary is a whole hour, an hour-component test is sufficient for this fixture. A boundary at 08:30 would need a fuller time comparison; HOUR alone cannot distinguish 08:15 from 08:45.
Advanced check: component hours are not duration hours
Suppose a numeric duration is 26.5 hours. Its day quantity is 26.5/24. Then:
=HOUR(26.5/24)
=(26.5/24)*24
Expected results are 2 and 26.5. The first extracts the wrapped clock-hour component; the second converts the entire day quantity into elapsed hours.
Similarly, for a complete interval from October 14 at 08:00 to October 15 at 10:30, subtract the timestamps and multiply by 24 to get 26.5. HOUR of that difference is only 2 and must not be labeled the full turnaround time.
Advanced example: reconstruct a time and reveal discarded data
With =DATE(2026,10,14)+TIME(8,45,30) in A2:
=TIME(HOUR(A2),MINUTE(A2),SECOND(A2))
Expected clock result: 08:45:30, whose day fraction is 31530/86400. This composition recovers the time components but deliberately omits the original date.
For the positive modern timestamp in this example, adding INT(A2) back to that time reconstructs the date and whole-second time. No claim is made about retaining subsecond precision, because the component functions return integer fields.
Avoid formatting and import traps
Changing a numeric result’s display to show AM/PM does not change the value extracted by HOUR. Likewise, changing a text cell’s display format does not necessarily parse it into a numeric time. TIMEVALUE addresses recognized time text separately.
If the intended input is a whole number of hours such as 8, do not pass that number directly and assume it means 08:00. In Excel serial arithmetic, whole numbers represent days; =HOUR(8) has the date-only midnight component 0, while =HOUR(TIME(8,0,0)) gives 8.
Remaining boundaries
The dedicated source does not establish a complete negative-serial, malformed-text, blank or Boolean error/coercion matrix here. No exact native behavior at floating-point subsecond boundaries is claimed. MINUTE and SECOND extract their own components rather than extending HOUR into a duration calculator.
References and verification
Expected results are independent calendar/arithmetic models or explicitly documented rules, not captured native output. Examples use English function names and comma separators. Input dates and schedules are fictional.