Let's look at some Excel Hour function examples and explore how to use the Hour function as a worksheet function in Microsoft Excel:
Summary
The Excel HOUR function returns the hour component of a time as a number between 0-23. For example, it will return 13 for 1:49 PM. You can use the HOUR function to extract the hour into a cell, or feed the result into another formula, like the TIME function.
The HOUR function is a built-in function in Excel that is categorized as a Date/Time Function.
The HOUR function is a built-in function in Excel that is categorized as a Date/Time Function.
Purpose
Get hour as a number (0-23) from a Time.
Return value
Number between 0 and 23.
What Does It Do ?
The function will show the hour of the day based upon a time or a number.
Syntax
Hour function has one syntax and hence they can be written in Three different ways:
=HOUR (serial_number) or
=HOUR(“time”) or
=HOUR(cell reference)
=HOUR (serial_number) or
=HOUR(“time”) or
=HOUR(cell reference)
Parameters or Arguments
Serial_number: The time value to extract the minute from.
Time: The time of the minute you are trying to find.
Cell reference: Reference to cells containing times.
Time: The time of the minute you are trying to find.
Cell reference: Reference to cells containing times.
Formatting
The result will be shown as a normal number between 0 and 23.
Usage notes
The HOUR function returns the hour from of a time or date as a number between 0-23. For example:
=HOUR("10:00 AM") // returns 10
=HOUR("10:00 PM") // returns 22
=HOUR("10:00 PM") // returns 22
Notes
- Excel stores dates and times as serial numbers. For example, the date Mar 1, 2010 12:00 PM is equal to the serial number 40238.5 in Excel. To check that Excel is correctly recognizing a date or time, you can temporarily format the date as a number.
- 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).
- Hour values will "rollover" after 24 Hours. You can use a formula to convert time values to decimal hours.
- #VALUE! error – Occurs when the given serial_number is not a valid Excel time.
- You can directly insert time value into the function. For example, =HOUR(“08:23 AM”).
- If you refer to a blank cell or only the date is given, and there’s no time it will return 0 in the result.
No comments:
Post a Comment