HOUR

HOUR(serial_number)

Returns the hour as an integer given a date serial number.

serial_numberThe time that contains the hour you want to find.

REMARKS
* This function returns a number between 0 and 23.
* The "serial_number" can be a time, value, cell reference or a text string in a time format.
* If "serial_number" < 0, then #NUM! is returned.
* If "serial_number" is not a valid time or date, then #VALUE! is returned.
* The time format can be any of those found on the "Format Cells" dialog box.
* If you want to enter a static time that will not change or update, use the shortcut key (Ctrl + Shift + ;).
* You can use the MINUTE function to return the minute as an integer given a date serial number.
* You can use the SECOND function to return the number of seconds as an integer given a date serial number.
* You can use the TIME function to return the time as a decimal given the hour, minute, second.
* You can use the TIMEVALUE function to return the time as a decimal given a time in text format.
* The equivalent VBA function is VBA.HOUR
* For the Microsoft documentation refer to support.microsoft.com
* For the Google documentation refer to support.google.com

 AB
1=HOUR(B1) = 1111:30:15
2=HOUR("11:30:15") = 11=NOW() = 19:16:28
3=HOUR("11:30:15 AM") = 11=NOW() = 45013.803
4=HOUR(B2) = 19 
5=HOUR(0.678) = 16 
6=HOUR(TIME(15,10,55)) = 15 
7=HOUR(TIMEVALUE("6:45:22 PM")) = 18 
8=HOUR(0) = 0 
9=HOUR(-10) = #NUM! 
10=HOUR("some text") = #VALUE! 


© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited Top