Over 2 million + professionals use CFI to learn accounting, financial analysis, modeling and more. Unlock the essentials of corporate finance with our free resources and get an exclusive sneak peek at the first module of each course.
Start Free
What is the HOUR Function?
The HOUR Function[1] is categorized under Excel DATE/TIME functions. The function returns the hour component of a time as a number between 0-23. For example, it will return 13 for 1:49 PM.
Formula
=HOUR(serial_number)
This function uses only one argument:
Serial_number (required argument) – The time that contains the hour we want to find. It will return the hour of the time value. The hour given will be an integer between 0 to 23 where 0 represents 12:00 AM and 23 represents 11:00 PM.
The argument can be entered as:
A decimal (serial number) representation of an Excel time
A text representation of a time
A reference to a cell containing a time
A time value returned from another Excel function or formula
How to use the HOUR Function in Excel?
As a worksheet function, the HOUR function can be entered as part of a formula in a cell of a worksheet. To understand the uses of the function, let’s consider an example:
Example 1
Let’s see how this function work when we have provided the following inputs:
The results in Excel are shown in the screenshot below:
In case we get an error, we need to remember that Excel stores dates and times as serial numbers. For example, the date January 1, 2000, 12:00 PM is equal to the serial number 32526.5 in Excel. To check that Excel correctly recognizes a date or time, we can temporarily format the date as a number.
A few things to remember about the HOUR Function
Time values are a portion of a date value and represented by a decimal number (for example, 12:00 PM is represented as 0.5 because it is half of a day).
#VALUE! error – Occurs when the given serial_number is not a valid Excel time.
Thanks for reading CFI’s guide to important Excel functions! By taking the time to learn and master these functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources:
To master the art of Excel, check out CFI’s Excel Crash Course, which teaches you how to become an Excel power user. Learn the most important formulas, functions, and shortcuts to become confident in your financial analysis.
Take your learning and productivity to the next level with our Premium Templates.
Upgrading to a paid membership gives you access to our extensive collection of plug-and-play Templates designed to power your performance—as well as CFI's full course catalog and accredited Certification Programs.
Gain unlimited access to more than 250 productivity Templates, CFI's full course catalog and accredited Certification Programs, hundreds of resources, expert reviews and support, the chance to work with real-world finance and research tools, and more.