Date & time function

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)
ArgumentWhat it means
serial_numberRequiredA 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

C2fx=HOUR(B2)
ABC
1OrderTime placedHour
2SO-771014:3514

Result: 14

The order was placed at 14:35, so HOUR returns 14 (2 PM).

2Flag night-shift clock-ins

B2fx=IF(OR(HOUR(A2)>=22,HOUR(A2)<6),"Night","Day")
AB
1Clock-inShift
222:10Night

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

B2fx=HOUR(A2)
ABC
1Weekly overtimeHOURTotal hours
230:006

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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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.

LanguageFunction name
CzechHODINA
DanishTIME
DutchUUR
FinnishTUNNIT
FrenchHEURE
GermanSTUNDE
HungarianÓRA
ItalianORA
Norwegian (Bokmål)TIME
PolishGODZINA
Portuguese (Brazil)HORA
Portuguese (Portugal)HORA
RussianЧАС
SpanishHORA
SwedishTIMME
TurkishSAAT

Recipes that use HOUR