# HOUR Function

> Return the hour of a time value from 0 to 23 with the HOUR formula function of TX Sheet Control: serial numbers, time text, #NUM! and #VALUE! errors.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > HOUR Function
- **215 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/hour/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/hour/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/hour/llms-full.txt

---

Return the hour of a time value as an integer from 0 to 23. `serial_number` is a date and time serial number, in which the fraction is the time of day. A negative number returns `#NUM!`. Unlike in Excel, time text such as "18:30" returns `#VALUE!`; convert it with [TIMEVALUE](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/timevalue/llms-full.txt) first.

### Syntax

```text
HOUR(serial_number)
```

Category: Date & Time. Minimum arguments: 1. Maximum arguments: 1.

Available for supported offline calculation.

### Examples

```text
=HOUR(45292)
```

The formula returns 0, because the serial number 45292 is midnight on January 1, 2024.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [HLOOKUP Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/hlookup/llms-full.txt)
- **Next:** [HSTACK Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/hstack/llms-full.txt)
