The HOUR function is a simple date function that extracts just the hour from a time value. If you are working with times but only care about the hours, the HOUR function lets you get rid of everything else. Remember that dates are really just saved as numbers by your spreadsheet with date formatting applied.
Purpose
The HOUR function returns the value of the hour from any given unit of time.
Video Explanation
Syntax
=HOUR(time)
Examples
Example 1 – Plain and Simple
Easy examples of the HOUR function.
Formula
Description
Result
=HOUR("3:31am")
Extract the hour value from 3:31am
3
=HOUR("3:31pm")
Extract the hour value from 3:31pm
15
Tip: Notice that the HOUR function adds twelve hours to denote PM.
Example 2 - Separating the values of a date and time.
Different date values examined using various functions.
8 A blank cell is December 30, 1899. Similar to tickmark 5.
9 Typing a 1 increments the value in number 8 above by 1 day. In other words "1=12/31/1899". It is just a matter of how it is displayed which can be controlled by going to the Format menu and choosing Number.
10 Just a decimal with no whole number increments the value by hours, minutes and seconds instead of days.
11 To get near the present date, you need to start with 43,000 days away from 12/30/1899.
Live examples in Sheets
Go to this spreadsheet for the examples of the YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND functions shown above that you can study and use anywhere you would like.