[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

TIME

Syntax:

TIME ( hour , minute , second )

Description: Computes the serial value for the given time.

Arguments:

Name

Type

Description

hour

number

A number in the range 0–32767, inclusive, truncated to integer, that represents the hour. Any value greater than 23 shall be divided by 24 and the remainder shall be treated as the hour value.

minute

number

A number in the range 0–32767, inclusive, truncated to integer, that represents the minute. Any value greater than 59 shall be converted to the corresponding number of hours and minutes.

second

number

A number in the range 0–32767, inclusive, truncated to integer, that represents the second. Any value greater than 59 shall be converted to the corresponding number of hours, minutes, and seconds.

 

Return Type and Value: number – The serial value for the given time, as a value greater than or equal to 0 and less than or equal to 1.

However, if hour, minute, or second are out of range, #NUM! is returned.

[Example: The following serial values are displayed with 16 decimal places.

TIME(0,0,0) results in a serial value of 0.0000000000000000
TIME(0,0,1) results in a serial value of 0.0000115740740741
TIME(0,0,2) results in a serial value of 0.0000231481481481
TIME(0,0,20) results in a serial value of 0.0002314814814815
TIME(2,3,20) results in a serial value of 0.0856481481481481
TIME(12,0,0) results in a serial value of 0.5000000000000000
TIME(23,59,59) results in a serial value of 0.9999884259259260
TIME(26,120,240) results in a serial value of 0.1694444444444450

end example]