HOUR function
Returns the hour (0 to 23) from a time or date-time value.
Available in All versions of Excel (Windows and Mac), Excel for Microsoft 365, Excel for the web
In every Excel versionWorks in Google Sheets
Syntax
HOUR(serial_number)| Argument | What it means | |
|---|---|---|
serial_number | Required | A time, a date-time, or text that looks like a time such as "14:35". |
Returns: A whole number from 0 (midnight) to 23 (11 PM).
How HOUR works
HOUR extracts the hour part of a time. Excel stores times as fractions of a day (12:00 is 0.5), and HOUR converts that fraction back into a clock hour from 0 to 23. Use it to classify timestamps — morning or afternoon orders, day or night shifts — or to group call-centre logs by hour.
HOUR only looks at the time-of-day part, so it never returns more than 23. That matters for durations: a shift total of 30 hours is stored as 1.25 days, and HOUR returns 6 (the clock part), not 30. For total hours of a duration multiply by 24 instead.
Examples
1Hour of an order timestamp
| A | B | C | |
|---|---|---|---|
| 1 | Order | Time placed | Hour |
| 2 | SO-7710 | 14:35 | 14 |
Result: 14
The order was placed at 14:35, so HOUR returns 14 (2 PM).
2Flag night-shift clock-ins
| A | B | |
|---|---|---|
| 1 | Clock-in | Shift |
| 2 | 22:10 | Night |
Result: Night
HOUR returns 22, which meets the ≥ 22 condition, so the clock-in is classified as a night shift.
3Durations over 24 hours wrap around
| A | B | C | |
|---|---|---|---|
| 1 | Weekly overtime | HOUR | Total hours |
| 2 | 30:00 | 6 |
Result: 6
30 hours is stored as 1.25 days. HOUR only reads the clock part (0.25 day = 6 hours). For the real total use =A2*24, which returns 30.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The argument is text that is not a recognisable time. | Check the text format or use TIME to build the value. |
Tips
- For decimal hours (e.g. 7.5) from a duration use
=A2*24, formatted as a number. - Display total hours beyond 24 with the custom format
[h]:mm.
Google Sheets
HOUR also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
HOUR in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | HODINA |
| Danish | TIME |
| Dutch | UUR |
| Finnish | TUNNIT |
| French | HEURE |
| German | STUNDE |
| Hungarian | ÓRA |
| Italian | ORA |
| Norwegian (Bokmål) | TIME |
| Polish | GODZINA |
| Portuguese (Brazil) | HORA |
| Portuguese (Portugal) | HORA |
| Russian | ЧАС |
| Spanish | HORA |
| Swedish | TIMME |
| Turkish | SAAT |