Excel HOUR Function (Example + Video)
When to Use Excel HOUR Function
Excel HOUR function can be used when you want to get the HOUR integer value from a specified time value.
What it Returns
It returns a value between 0 (12:00 A.M.) and 23 (11:00 P.M.) depending on the time value used as the input.
- serial_number: the time value that contains the hour that needs to be determined.
The argument can be provided in different formats:
As a serial number: The integer part of the serial number represents the date and the decimal portion represents time. For example, if you are using 41640.5 as the serial number, it would return 12 (as the decimal portion 0.5 represents 12:00 PM, which is half of a full day)
As text: =HOUR(“12:00 PM”) would return 12.
- As a result of some other formula. For example, =TIMEVALUE(“6:45 PM”)
- Excel stores dates and time as serial numbers.
Excel HOUR Function – Examples
Here are five practical examples of using the Excel HOUR function.
Example #1 – Entering Time as Text
Excel Hour function can take the time within double quotes as the input. It then returns the integer between 0 and 23 based the time. For this to work, the time has to be in a format that Excel interprets as time.
If you enter the time without AM/PM (as shown in A2 in the above example) Excel will consider it as the time in the 24-hour format.
Make sure you enter time in a format that is recognized by Excel. For example, “12 Noon” wouldn’t count as a valid format, and would return a #VALUE! error.
Example #2 – Enter Cell Reference that has the Time
As shown in the examples above, you can use the cell reference that contains the time value. Note that if you don’t use AM/PM, the HOUR function would take it in the 24 Hour format.
Example #3 – Using Numerical Values in Exel Hour Function
If you use a numeric value within Excel HOUR Function, it will use the decimal portion of it to return the HOUR value. For example, if I use 41699.125 as the input in HOUR function, it will discard the 41699 part and use .125 part to return the time. The answer would be 3 as .125 represents three hours.
Example #4 – Using the Result of Excel HOUR function in Calculations
The output of the Excel HOUR function is an integer which can be used in formulas/calculations. For example, you can add/subtract values from the result of the HOUR function as shown above.
Excel HOUR Function – Video
Related Excel Functions:
You May Also Like the Following Tutorials:
- Excel Timesheet Calculator Template.
- How to Insert Date and Timestamp in Excel.
- Excel Timesheet Calculator template.
- Excel Calendar Template.