HOUR

Formulas / HOUR
Extract the hour from a time.
=HOUR(serial_number)
  • serial_number - required argument for specifying the time

Examples

  • =HOUR("4:30 PM")

    The HOUR function returns the hour number of a time value. This example returns 16.

  • =HOUR(A1)

    The HOUR function can also be used to return the hour number from a cell that contains a time value. If cell A1 contains the time value "4:30 PM", will also return 16.

  • =HOUR("23:59")

    The HOUR function will return a number between 0 and 23, depending on the time you specify, and will return 23.

  • =HOUR("1/1/2020 4:30 PM")

    The HOUR function can also be used to return the hour number from a date and time value, and will return 16.

  • =HOUR(A1)

    The HOUR function can also be used to return the hour number from a cell that contains a date and time value. If cell A1 contains the date and time value "1/1/2020 4:30 PM", then will also return 16.


Summary

The HOUR function is used to return the hour of a time value as an integer. It takes a time value as a decimal number, which can be a text string, decimal number, or formula/function result.

  • The HOUR function takes one argument - serial_number - and returns a number between 0 and 23 as the hour from a time zone.
  • The HOUR function resets every 24 hours and works with hour values larger than 24 using a formula to convert time to decimal hours.

Frequently Asked Questions

What does the HOUR function do?
The HOUR function returns the hour of a time value as a number. The hour is an integer, which represents the hour from 0 to 23.
How can I enter a time value?
Times can be entered as text strings within quotation marks. The text strings may also be entered as decimal numbers. The HOUR function takes a time value as a decimal number.
What type of number is returned by the HOUR function?
The HOUR function returns an integer, which represents the hour from 0 to 23.
Can I enter a text string into the HOUR function?
Yes, times can be entered as text strings within quotation marks.
Sourcetable Logo

Work smarter

Al is here to help. Leverage the latest models to
analyze spreadsheets, enrich data, and create reports.

Drop CSV