Excel function

HOURfunction

Returns the hour of a time as a number.

All versions
=HOUR("14:30:45")

Time8 chars

11
24
3:
43
50
6:
74
85

Change the time to "9:05" or "23:59:59". Without seconds, they are treated as 0. Try breaking it on purpose to see the errors.

Result

14

serial_number

The time to take the hour from. In a real sheet this is a cell with a time, or NOW() or TIME().

What is the HOUR function?

=HOUR(serial_number)

HOUR returns only the hour of a time as a number from 0 to 23.

You can pass a cell with a time, the result of TIME or NOW, or text such as "14:30:45". The part taken is highlighted in green.

Timesheets are the usual place for HOUR: counting how many people clocked in during each hour, or splitting off work done after 6 PM as overtime. Once a time becomes a plain hour number, COUNTIF can count each hour band and IF can sort shifts into early and late.

Arguments

serial_number
The time to take the hour from. If it includes a date, only the time part is used.

HOUR examples

  1. Example 1. Take the hour

    =HOUR("14:30:45")

    14.

  2. Example 2. From the current time

    =HOUR(NOW())

    The hour of the current time.

  3. Example 3. The hour of different times

    =HOUR(A2)

    Minutes and seconds are dropped and only the whole hour is left. 0.75 is three quarters of a day, so it is 18.

    A2=HOUR(A2)
    9:059
    13:45:3013
    23:59:5923
    0.7518
  4. Example 4. Early or late shift

    =IF(HOUR(B2)<12, "Early", "Late")

    A start time B2 before noon is the early shift: 7:30 is Early and 13:00 is Late.

Common mistakes

FAQ

How do I put the parts back together?
Use TIME.
And the date part?
Use YEAR, MONTH and DAY.
How do I count entries per hour?
Put =HOUR(A2) in a helper column and count with =COUNTIF(B:B, 9).
How do I turn 9:30 into 9.5 hours?
Use =A2*24 and format the result as General.