Skip to content

SECOND

Returns the seconds of a time or timestamp as a whole number from 0 to 59.

Syntax

=SECOND()

Date and time

All versions of Excel.

Try it

Edit the formula in B2 or change the inputs. The sheet recalculates as you type.

B2
A
B
C
1
Time
Seconds
2
14:45:30
30
3

B2 =SECOND(A2) returns 30

How SECOND works

SECOND returns the seconds part of a time as a whole number from 0 to 59. =SECOND(TIME(14,45,30)) returns 30. It ignores the hour and the minute. SECOND completes the set with HOUR and MINUTE.

The one argument

serial_number is the time. It can be a real time value, a timestamp that includes a date, or text that Excel reads as a time. The date part is ignored. Text that isn't a valid time, such as "10:15:99", returns #VALUE!.

Seconds of the minute, not elapsed seconds

SECOND returns the seconds within the current minute, so it never goes above 59. A stopwatch time of 1:02:03 returns 3. To convert a whole time to seconds, combine the three parts:

=HOUR(A2)*3600+MINUTE(A2)*60+SECOND(A2)

For 1:02:03 that is 3,600 + 120 + 3 = 3,723. For the gap between two timestamps, subtract them and multiply by 86,400, the number of seconds in a day: =(B2-A2)*86400.

Where it is useful

  • Splitting a lap or log time: show the seconds in their own column next to minutes.
  • Checking for whole minutes: =SECOND(A2)=0 is true on the minute mark.
  • Cleaning timestamps: rebuild a time without the seconds with =TIME(HOUR(A2),MINUTE(A2),0).
  • Building a timer total: convert each part to seconds, then add them.
  • Finding records at a given second: =SUMPRODUCT(--(SECOND(A2:A100)=0)) counts events that fall exactly on a minute.

Rounding

Excel stores times as fractions of a day, and fractions of a second can't always be stored exactly. Excel rounds to the nearest whole second before it reads the value, so 10:15:41.6 returns 42. If you subtract timestamps and then read the seconds, tiny floating-point differences can occasionally tip the result by one second. Round the time first with =ROUND(A2*86400,0)/86400 when this matters.

Text times

Text times work without conversion: =SECOND("10:15:42") returns 42. If a whole column of imported times is text, convert it with TIMEVALUE first and work from real time values.

SECOND and the date

SECOND discards the date and the larger parts of the time. If your analysis spans several days or hours, include them in your grouping key.

Arguments

serial_number
The time to read: a cell holding a time or a date-and-time, a value built with TIME, or text Excel reads as a time, such as "10:15:42". A decimal is read as a fraction of a day.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Seconds from a time

B2 =SECOND(A2)

Result: 30

Only the seconds part is returned.

B2
A
B
C
1
Time
Seconds
2
14:45:30
30
3

B2 =SECOND(A2) returns 30

Example 2

Seconds from a text time

B2 =SECOND(A2)

Result: 42

SECOND reads text that Excel recognises as a time.

B2
A
B
C
1
Log time (text)
Seconds
2
10:15:42
42
3

B2 =SECOND(A2) returns 42

Example 3

Total seconds in a duration

B2 =HOUR(A2)*3600+MINUTE(A2)*60+SECOND(A2)

Result: 3723

1 hour is 3,600 seconds, 2 minutes is 120 and 3 seconds is 3, which adds to 3,723.

B2
A
B
C
1
Duration
Total seconds
2
1:02:03
3723
3

B2 =HOUR(A2)*3600+MINUTE(A2)*60+SECOND(A2) returns 3723

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B2, return the seconds part of the lap time in A2. Fill it down to B4.

Answer in B2, then it fills down to B4.

B2
A
B
C
D
E
1
Lap time
Seconds part
Total seconds
2
0:01:45
3
0:02:10
4
0:03:05
5

Common mistakes

  • SECOND returns the seconds of the minute, from 0 to 59. It is not the total number of seconds in a duration.
  • SECOND ignores the date, the hour and the minute. Add them to your grouping key if you need them.
  • Excel rounds to the nearest whole second, so a time of 10:15:41.6 returns 42.
  • Text that isn't a valid time returns #VALUE!.

Questions people ask

How do I get the seconds from a time in Excel?

Use `=SECOND(A2)`. It returns the seconds part, from 0 to 59.

How do I convert a time to total seconds?

Use `=HOUR(A2)*3600+MINUTE(A2)*60+SECOND(A2)`, or `=A2*86400` for a duration stored as a time value.

Why does SECOND sometimes seem off by one?

Times are stored as fractions of a day, so a calculated time can sit a tiny amount below a whole second. Round the time to the nearest second first.

Does SECOND work on a timestamp with a date?

Yes. It ignores the date and returns the seconds of the time part.

Learn SECOND in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.