TIME


returns the time, given hours, minutes and seconds.

Syntax:

TIME(hours, minutes, seconds)

returns the time, expressed as a date-time serial number. hours, minutes and seconds are integers.

If hours, minutes and seconds are not within range for a valid time, the time will 'roll over', as shown below.

Example:

TIME(9, 31, 20)

returns the time 9:31:20 am (as a date-time serial number).

TIME(9, 31, 75)

returns 9:32:15 am - the time rolls over, as there are only 60 seconds in a minute.

Application:

Let's consider a scenario in a manufacturing plant where we need to calculate the duration of production runs.


Scenario: A factory produces widgets on three different machines. We want to track the start time, end time, and total production duration for each batch. The start and end times are recorded in separate columns for hours, minutes, and seconds.


Here's how we can use the TIME function in a table to solve this problem:

Machine ID

Start Hour

Start Minute

Start Second

End Hour

End Minute

End Second

Start Time

End Time

Duration (in hours)

A
B
C
D
E
F
G
H
I
J
1
A-101
8
0
0
12
30
0
8:00 AM
12:30 PM
5
2
B-202
9
15
0
16
45
0
9:15 AM
4:45 PM
8
3
C-303
11
0
0
18
0
0
11:00 AM
6:00 PM
7
4
A-101
13
45
0
17
15
0
1:45 PM
5:15 PM
4

Explanation:

  • Columns B through G: These columns contain the raw data. The factory workers or an automated system record the start and end times by separating the hour, minute, and second into different columns.
  • Column H (Start Time): This is where the TIME function is used. The formula TIME(B1,C1,D1) takes the values from Start Hour, Start Minute, and Start Second to create a single, unified time value. For the first row, this would result in 8:00 AM.
  • Column I (End Time): Similarly, the formula TIME(E1,F1,G1) creates a time value for the end of the production run. For the first row, this would be 12:30 PM.
  • Column J (Duration): This is the ultimate goal. Once we have the start and end times in a usable format, we can subtract the start time from the end time. The result of (I1-H1) is a fraction of a day. To convert this fraction into a more readable format, we multiply by 24 (the number of hours in a day).




This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof