Features of !SEMTools
↑ Навигация по задачам в Excel и возможностям надстройки !SEMTools ↑

HOUR

HOUR function in Excel - formula examples
Function CategoryDate and Time
VolatilityNon-volatile
Related FunctionsMINUTE — extracts the minute portion
SECOND — extracts seconds
TIME — assembles a time value from hours, minutes and seconds

What Does the HOUR Function Do?

The HOUR function is used to extract the hour number from a time or date value. It returns an integer from 0 to 23, corresponding to the hour in 24-hour format.

HOUR function syntax

=HOUR(time)

The time argument can be a reference to a cell with a date/time, the result of another function, or a string value recognized as time (e.g., "13:45").

HOUR formula examples

Extract the hour from time in cell A1:

=HOUR(A1)
HOUR from time, date-time and numbers
B2=HOUR(A2)
ABC
1ValueHOURMINUTE
218:3018=HOUR(A2)30=MINUTE(A2)
36:45 AM6=HOUR(A3)45=MINUTE(A3)
410/22/2026 23:5923=HOUR(A4)59=MINUTE(A4)
510/22/20260=HOUR(A5)0=MINUTE(A5)
60.75 (number)18=HOUR(A6)0=MINUTE(A6)
71.5 (number)12=HOUR(A7)0=MINUTE(A7)

HOUR looks only at the fractional part of the value: 0.75 of a day is 18:00, and 1.5 (a day and a half) is 12:00. A date without time gives 0. HOUR never returns more than 23 — for durations over a day, use =INT(A2*24).

If A1 contains 18:30, the formula returns 18.

Extract the hour from date and time:

=HOUR(NOW())
Grouping by hour
C2=IF(AND(B2>=6,B2<14),"Morning",IF(AND(B2>=14,B2<22),"Day","Night"))
ABC
1TimeHourShift
207:157=HOUR(A2)Morning=IF(AND(B2>=6,B2<14),"Morning",IF(AND(B2>=14,B2<22),"Day","Night"))
313:4013=HOUR(A3)Morning=IF(AND(B3>=6,B3<14),"Morning",IF(AND(B3>=14,B3<22),"Day","Night"))
422:0522=HOUR(A4)Night=IF(AND(B4>=6,B4<14),"Morning",IF(AND(B4>=14,B4<22),"Day","Night"))

HOUR(NOW()) returns the current hour and updates on every recalculation. The same check against fixed time slots assigns events to shifts.

The formula returns the current hour at the time of calculation.

HOUR features and limitations

  • The function works with both pure time and full dates.
  • If the value doesn't contain time, the result will be 0.
  • For proper operation, the cell must be recognized as time or date.
  • MINUTE — extracts the minute portion
  • SECOND — extracts seconds
  • TIME — assembles a time value from hours, minutes and seconds

Other Date and Time Functions in Excel

TIMEVALUE, TIME, YEAR, DATE, DATEVALUE, EDATE, DAY, WEEKDAY, YEARFRAC, EOMONTH, MONTH, MINUTE, WEEKNUM, WORKDAY, DATEDIF, TODAY, SECOND, NOW, NETWORKDAYS

Like the article? Help its author! Buy !SEMTools, it has lots of useful instruments to process text data.