HOUR Function in ONLYOFFICE Spreadsheet Editor: Syntax, Worked Examples and Checks
Extract the 24-hour clock hour from a recorded time, without mistaking a time fraction for an hour count.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
HOUR function in ONLYOFFICE Spreadsheet Editor
Quick answer
Read the hour-of-day component from a spreadsheet time value (0 through 23). In the official English reference, use HOUR(serial_number). All outputs here are independent expected results, not results observed in ONLYOFFICE. Official HOUR documentation.
When to use HOUR
Extract the 24-hour clock hour from a recorded time, without mistaking a time fraction for an hour count. Use this function in a time-of-day reporting column, for checking imported clock readings or as one piece of a more explicit scheduling formula. A displayed time and its numeric day fraction are different views of the same intended value. If you need an elapsed duration, first decide how dates, overnight crossings and missing values are represented; extracting a clock component is not a complete duration calculation.
Exact official syntax and arguments
=HOUR(serial_number)
The official HOUR reference documents an integer from 0 through 23. The arguments appear in the following order:
| Parameter | Required | Expected type and interpretation | Omitted default |
|---|---|---|---|
serial_number |
Yes | The time value containing the hour. The vendor permits a recognized time string, a decimal time number, or a result of another time formula. | None documented |
Only one required parameter is shown. This guide deliberately avoids assuming undocumented type coercion, rounding of noninteger seconds, or handling of negative serials. The time serial may represent a fraction of a 24-hour day; for example the vendor describes decimal 0.56 as 13:26 and, in the SECOND reference, explicitly 13:26:24. This is an example of the time-component model, not a claim that a digit sequence such as 0.56 should be read as decimal-clock notation.
Version, editor, language and time-format scope
The current ONLYOFFICE Spreadsheet Editor function catalogue lists the function, and the dedicated official page documents its English signature. These pages are not a version-by-version execution matrix. The first Docs release, first Desktop release, and supported mobile builds for this specific function are not established here. The Docs changelog and Desktop changelog are separate histories; no unsubstantiated introduction version is assigned.
- Docs / web editor: documented in the generic Spreadsheet Editor help. Verify the exact server and editor build where a workbook will be used; this research did not open a running Docs environment.
- Desktop Editors: a separate product and release history. No installed Windows, macOS or Linux Desktop Editor was used to calculate these examples; do not infer tested desktop behaviour from the Docs help page.
- Mobile, integrations and old builds: not tested and not guaranteed by the function’s unversioned entry. If a formula is unexpectedly unsupported, check the build and its Insert Function picker before adapting the workbook.
- Formula language: Advanced Settings documents a Formula Language setting. The formulas here intentionally use English function names and the comma-separated syntax given in the English reference and Insert Functions guide. A non-English installation can show translated function names; do not assume that English text can always be pasted unchanged.
- Region and display: the same settings page documents Region, time-display differences and configurable decimal/thousands separators. It does not promise one universal interpretation of ambiguous text such as
"03:04"across languages. These workbook exercises rely on numeric arguments created withTIME, avoiding most free-text parsing ambiguity. - Date system: the same page documents a 1904 date system option. The sample table uses pure clock times, but combining times with calendar dates in other workbooks requires knowledge of the source date serial system. This analysis does not claim equality at 1900/1904 boundaries.
Evidence access date: 2026-10-11 (UTC). The general official index was previously enumerated as 484 documented names on 2026-10-11; the four entries in this batch were spot-checked again, not a new census of all function names. There are no claimed native execution results in this guide.
Shared reproducible practice sheet
Create a new worksheet and enter the headings below. Type numbers, not quoted text, into columns A–C. In D2, enter =TIME(A2,B2,C2), then fill down to D9. Format D2:D9 explicitly as a time with seconds (hh:mm:ss when available). In E2, enter =HOUR(D2); in F2, enter =MINUTE(D2); in G2, enter =SECOND(D2); fill each down to row 9. The following is a Python Fraction arithmetic fixture, not an ONLYOFFICE execution transcript.
| Row | A: hour | B: minute | C: second | D: expected display | E: HOUR | F: MINUTE | G: SECOND |
|---|---|---|---|---|---|---|---|
| 2 | 0 | 0 | 0 | 00:00:00 | 0 | 0 | 0 |
| 3 | 9 | 5 | 7 | 09:05:07 | 9 | 5 | 7 |
| 4 | 13 | 39 | 15 | 13:39:15 | 13 | 39 | 15 |
| 5 | 23 | 59 | 58 | 23:59:58 | 23 | 59 | 58 |
| 6 | 12 | 0 | 0 | 12:00:00 | 12 | 0 | 0 |
| 7 | 6 | 30 | 0 | 06:30:00 | 6 | 30 | 0 |
| 8 | 18 | 45 | 30 | 18:45:30 | 18 | 45 | 30 |
| 9 | 1 | 2 | 3 | 01:02:03 | 1 | 2 | 3 |
Function-specific worked formulas
The D-column times are built from the practice sheet below. These are expected outputs computed independently of ONLYOFFICE, not observed results. Enter the formulas in empty cells (e.g., J2 onward) to compare:
| Enter formula | Expected result | What it tests |
|---|---|---|
=HOUR(D2) |
0 | Midnight is hour zero |
=HOUR(D3) |
9 | 09:05:07 is in the 9 a.m. hour |
=HOUR(D4) |
13 | 13:39:15 is 1 p.m. on a 12-hour clock |
=HOUR(D5) |
23 | 23:59:58 belongs to the 23rd hour |
=HOUR(D6) |
12 | Noon is 12 rather than 0 |
=HOUR(0.75) |
18 | Three quarters of a day = 18:00 |
Advanced practical applications
1. Classify a morning versus an afternoon shift
Place =IF(HOUR(D3)<12,"AM","PM") in J3 and =IF(HOUR(D6)<12,"AM","PM") in J6.
Independently calculated expectation: Expected AM for D3 (09:05:07) and PM for D6 (12:00:00).
Boundary and interpretation: The classification is based on clock hour, not a shift policy. Midnight is assigned AM; noon is PM. A night-shift definition may need more conditions.
2. Build an hour-of-day reporting column
Enter =HOUR(D2) into E2 and fill through E9. Group by the integers 0–23 in your chosen analysis tool.
Independently calculated expectation: Expected E2:E9 = 0, 9, 13, 23, 12, 6, 18, 1.
Boundary and interpretation: This returns clock hours; it does not count elapsed hours in a duration such as 27 hours.
3. Read the hour from a date-time expression
Enter =HOUR(DATE(2026,10,11)+TIME(22,10,0)) in J4.
Independently calculated expectation: Independently expected 22.
Boundary and interpretation: The calendar date is numeric and the fractional-day time is added. The 1900/1904 setting changes date serials, so retain the date-system context when importing workbooks.
4. Compare a clock hour to an exact time
With D4 = 13:39:15, compare =HOUR(D4)>=13 to =D4>=TIME(13,30,0).
Independently calculated expectation: Both are expected TRUE for this row, but they ask different questions.
Boundary and interpretation: At 13:10, the first comparison would still be TRUE while the second would be FALSE. Do not use HOUR alone when minute-level thresholds matter.
Reproduce the calculation in ONLYOFFICE
- Create a fresh spreadsheet in your chosen editor and confirm it is in edit mode.
- Set Formula Language and Region intentionally in Advanced Settings. These examples use the English function names and commas.
- Enter the fixed numerical input values in the practice sheet. Use the Formula tab or the official Insert Function instructions to confirm the available name and argument order.
- Enter the example exactly as written, including the leading
=. If it is shown literally as text, remove text-only formatting and re-enter in a formula-capable cell. - Select D2:D9 and format as time with visible seconds. Select E:G as General/Number, not date or time. If the cell shows a fraction rather than a clock, check the number format before changing the formula.
- Compare each observed result to the independently calculated expectation. For production workflows, record the editor product, build, operating system/browser, formula language, region and workbook date system alongside any test results.
The official Insert Functions guide also documents recalculating via Formula → Calculation; if an output looks stale after editing referenced cells, trigger recalculation before troubleshooting a formula.
Common mistakes, limits and troubleshooting
- Confusing 0.5 with 0:30. A time number of 0.5 represents half a day, so
HOUR(0.5)is expected to be 12, not zero hours and 30 minutes. - No minutes are returned. HOUR(13:59) still returns 13. Use MINUTE for 59, or compare the underlying cell directly to a TIME threshold.
- Duration totals are different. A display such as 27:15 may require duration formatting or arithmetic; HOUR provides an hour-of-day part and is not an elapsed-hours total.
- Recognized text is locale-sensitive. Official help permits time strings, but regional parsing, AM/PM conventions and ambiguous imported text need native checks.
Unexpected error or missing function: The official quick reference does not give a complete error-code matrix for blanks, boolean inputs, malformed time text, negative values, out-of-range TIME fields or locale-specific parsing. No specific #VALUE!, #NUM!, or #NAME? behaviour is claimed as observed in ONLYOFFICE. If a workbook produces one of these, capture the exact formula, source cell values/types, installed edition/version, selected formula language and screenshot, then compare against a control using valid numeric TIME values. If a time is present but seems wrong, try displaying the underlying value in General format and explicitly applying a seconds-visible time format.
Avoid near-boundary floating-point assertions: Fractional-day values can be represented in floating point. SECOND/MINUTE expectations for noninteger times close to a roll-over boundary were not natively established by these independent integer-second fixtures. If precision is operationally important, collect real installed-build test results before treating a boundary case as supported.
Cross-software compatibility: what is and is not verified
ONLYOFFICE and current LibreOffice Calc documentation both describe an hour component ranging from 0 to 23, but local separators, string parsing and date serialization should not be presumed identical. LibreOffice HOUR reference.
| Topic | ONLYOFFICE documentation | Other apps / remaining checks |
|---|---|---|
| Function name | English name HOUR, confirmed in the vendor function index |
Similar names in other spreadsheet apps do not prove identical edge cases |
| Argument syntax | HOUR(serial_number) |
Separator and translated function naming can differ by locale/software |
| Time display | Controlled by formatting/region, not solely by the function | Date/time serial conventions and display formats can vary |
| Verification in this article | Documentation + independent rational arithmetic | No ONLYOFFICE Docs, Desktop or mobile formula execution; no imported XLSX round-trip |
Frequently asked questions
Why does HOUR return 0 for midnight?
Midnight is 00:00 on the 24-hour clock. The documented result range starts at 0.
Can HOUR tell whether a shift is overnight?
Not alone. You need both start and end times and a defined day-rollover rule.
What if HOUR is not suggested by autocomplete?
Verify that the installed formula language is English, the editing mode permits formulas, and the product build offers the function in its picker.
Related concepts and verified reference links
Official reference and verification
- ONLYOFFICE Spreadsheet Editor — function documentation
- current ONLYOFFICE Spreadsheet Editor function catalogue
- Docs changelog
- Desktop changelog
- Advanced Settings
- LibreOffice HOUR reference
- TIME: build a time from hour, minute and second
Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in ONLYOFFICE Spreadsheet Editor.
- No genuine ONLYOFFICE Spreadsheet Editor screenshots are included; this guide does not use mock application images.