HOUR(serial_number) returns the hour of the day, as an integer from 0 through 23.
Excel represents a day by one unit, so 0.5 is noon. A full date-time serial can be supplied;
this function extracts a clock component rather than an elapsed duration.
The argument may be a serial number, a time produced by another formula, or time text that the
locale can parse. Text parsing and component extraction are separate operations.
Try it
Start with =HOUR(0.5). Compare =HOUR(TIME(12,34,56)), =MINUTE(TIME(12,34,56)) and
=SECOND(TIME(12,34,56)) to see the three components of the same time.
Quirks
A day has 24 hours and each hour and minute has 60 subdivisions. The component wraps; for total
elapsed hours, minutes or seconds, use arithmetic on the duration rather than this extractor.
On Excel 16.0.20527.20088 for Windows, HOUR(0.999999) returns 0, carrying a time just before midnight into the next day.
The documentation describes the returned component, but does not specify every binary64 boundary
or intermediate rounding. A simple floor of a scaled fractional day is therefore an incomplete
compatibility specification. Invalid date/time input and negative serial handling also need the
target workbook's date-system rules.
How to implement
Separate argument coercion and range checks from the clock calculation. Preserve the numeric
serial as binary64. OneCalc's compatibility candidate first adds 0.5/86400 to the serial,
then takes its fractional day. It multiplies by 24, takes the integer hour, multiplies the
remaining fraction by 60, takes the integer minute, and multiplies the next remainder by 60 to
obtain the integer second, reduced modulo 60.
That operation order matters near a boundary. Computing a single rounded total-second integer
and splitting it is a sensible mathematical design, but is not established as interchangeable
with this sequence. Test a value and its adjacent binary64 neighbours around each second, minute,
hour and midnight transition. Do not let date formatting decide the numeric result.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
No implementation has been published with a Handbook test suite for this function.
Version differences
The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.
Excel 16.0 build
Platform and CPU
Captured inputs
20430
Windows, 64-bit, CPU not recorded
14,631
The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.
14,631 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.
Alternatives
Use TIME to construct a clock value and TIMEVALUE to parse
text. For elapsed time, multiplying a duration by 24, 1440 or 86400 retains the full interval.
TEXT or a cell format controls presentation without extracting a numeric component.