Astra

How to Use HOUR Function in Excel – Examples

Estimated reading: 2 minutes

The HOUR function in Excel is a date and time function that returns a decimal value for the hour component of a given time.

Syntax of HOUR Function 

=HOUR(serial_number)

Argument of the HOUR Function

serial_number– represents the date and/or time value for the hour component that you want to extract. Excel uses the serial number to represent dates and times, with each day represented by a whole number and time represented by a decimal value.

Return of HOUR Function

In Excel, the HOUR function returns the hour component of a given time as a decimal value. It returns an integer between 0 and 23, representing the time of day in 24-hour format.

Example #1: Basic Application of HOUR Function

Let’s check the output of the HOUR function for different input types

See the result and the comments in the image below:

hour function in excel

Things to Keep in Mind about HOUR Function

  • #VALUE! error: This occurs when the HOUR function’s input is not a valid time or date/time value. If you try to extract the hour from a text string that does not represent a valid time value, for example, the function will return this error.
  • #REF! error: This error occurs if the cell or range containing the HOUR function’s input has been deleted or moved.
  • #NUM! error: This occurs when the HOUR function’s input is not recognized as a valid time or date/time value.

Conclusion:

Finally, the HOUR() function in Excel is a useful tool for extracting the hour component from a given time value. You can easily manipulate and analyze time data in your programming or spreadsheet projects by using the HOUR() function effectively.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc
Jump to Topics
SOLVED EXCEL
Scroll to Top