TIME(hour, minute, second)

Returns the time as a decimal given an hour, minute, second.

hourThe hour component, between 0 and 23.
minuteThe minute component, between 0 and 59.
secondThe second component, between 0 and 59.

Remarks

* If the cell has the "General" number format, then this cell is formatted automatically to "h:mm AM/PM"
* If "hour" > 23, then "hour" Mod 24 is used.
* If "hour" < 0, then #NUM! is returned.
* If "minute" > 59, then "minute" is converted to hours and minutes.
* If "minute" < 0, then the minutes are subtracted from (hour * 60).
* If "minute" < 0 and (hour * 60) - minute < 0, then #NUM! is returned.
* If "second" > 59, then "second is converted to minutes and seconds.
* If "second" > 32767, then #NUM! is returned.
* If "second" < 0, then the seconds are subtracted from the ( (hour * 60) * 60 ) = (minutes * 60) )
* If "second" < 0 and ( (hour * 60) * 60) < 0, then #NUM! is returned.
* You can use the DATE function to return the date serial number given a year, month, day.
* You can use the HOUR function to return the hour as an integer given a date serial number.
* You can use the MINUTE function to return the minutes as an integer given a date serial number.
* You can use the NOW function to return the serial number of the current system date and time.
* You can use the SECOND function to return the seconds as an integer given a date serial number.
* You can use the TEXT function to return a number as a formatted text string.
* You can use the TIMEVALUE function to return the time as a decimal given a time in text format.
* For the Microsoft documentation refer to support.office.com

 A
1=TIME(12,0,0) = 0.50
2=TIME(12,0,0) = 12:05:00 AM
3=TIME(12,0,-20) = 11:59:40 AM
4=TIME(12,0,120) = 12:02:00 PM
5=TIME(12,0,-120) = 11:58:00 AM
6=TIME(12,-20,0) = 11:40:00 AM
7=TIME(12,120,0) = 2:00:00 PM
8=TIME(12,-120,0) = 10:00:00 AM
9=TIME(40,0,0) = 4:00:00 PM
10=TEXT(TIME(23,18,14),"h:mm:ss AM/PM") = 11:18:14 PM
11=TIME(1,-61,0) = #NUM!
12=TIME(1,0,-3601) = #NUM!
13=TIME(-20,0,0) = #NUM!
14=TIME("some text",-10,0) = #VALUE!

1 - What is the decimal number for the time 12:00:00.
2 - What is the time for the hour 12, the minute 0 and the second 0. This cell has been formatted with the number format "hh:mm:ss AM/PM".
3 - What is the time for the hour 12, the minute 0 and the second -20. The 20 seconds have been taken away from the hour and minutes.
4 - What is the time for the hour 12, the minute 0 and the second 120. The 120 seconds have been added to the hour and minutes.
5 - What is the time for the hour 12, the minute 0 and the second -120. The 120 seconds have been taken away from the hour and minutes.
6 - What is the time for the hour 12, the minute -20 and the second 0. The 20 minutes have been taken away from the hour.
7 - What is the time for the hour 12, the minute 120 and the second 0. The 120 minutes have been added to the hour.
8 - What is the time for the hour 12, the minute -120 and the second 0. The 120 minutes have been taken away from the hour.
9 - What is the time for the hour 40, the minute 0 and the second 0. The 40 hours have been added to 12:00:00 AM.
10 - What is the time for the hour 23, the minute 18 and the second 14. This time has been converted into the text format "h:mm:ss AM/PM".
11 - What is the time for the hour 1, the minute -61 and the second 0. When 61 minutes is taken away from the hour 1 (60 minutes) there is a negative amount of minutes so #NUM! is returned.
12 - What is the time for the hour 1, the minute 0 and the second -3601. When 3601 seconds is taken away from the hour 1 (3600 seconds) there is a negative amount of seconds so #NUM! is returned.
13 - If the "year" < 0, then #NUM! is returned.
14 - If any of the arguments are not numeric, then #VALUE! is returned.

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