SECONDfunction takes a time value and returns the seconds component of that time as a number between 0 and 59. This function is most commonly used to extract the seconds portion of a time value in order to perform calculations or comparisons based on seconds.
- How to use
- Examples of using
SECONDformula not working?
- Similar formulas to
SECOND formula with the syntax shown below, it has 1 required parameter:
- time (required):
The time value from which to extract the seconds component. This can be a cell reference or a direct time value input.
ExamplesHere are a few example use cases that explain how to use the
SECONDformula in Google Sheets.
If you have two time values and want to calculate the duration in seconds between them, you can subtract the
SECOND value of the start time from the
SECOND value of the end time.
Conditionally formatting based on seconds
You can use the
SECOND function in a conditional formatting rule to highlight cells that have a certain number of seconds, such as all cells with a seconds value greater than 30.
You can use the
SECOND function in combination with other date and time functions to create a timestamp that includes the seconds component of a time value.
SECONDnot working? Here are some common mistakes people make when using the
SECONDGoogle Sheets Formula:
Incorrect argument type
The input for the SECOND formula should be a valid date or time value. Check that the input cell contains a valid date or time value, and that it is formatted correctly.
Using an unsupported date format
The SECOND formula supports only a limited range of date formats. Make sure you are using a supported format, such as 'yyyy-mm-dd'.
Referencing a blank cell
If the cell referenced by the SECOND formula is blank, the formula will return an error. Make sure the referenced cell contains a valid date or time value.
The following functions are similar to
SECOND or are often used with it in a formula:
MINUTEfunction in Google Sheets returns the minute of the hour for a given date or time value. It takes a single argument,
time, which is the date or time value to extract the minute from.
HOURfunction returns the hour component of a given time. This function is most commonly used to extract the hour value from a timestamp or a time value. The function takes one parameter, which is the time to extract the hour component from.
TIMEfunction takes in three arguments: hour, minute, and second, and returns a time value. This function is commonly used in combination with other functions to perform time-related calculations.
DATEformula is used to create a date object in Google Sheets. It takes three arguments: year, month, and day and returns a date. This formula is useful when you need to perform date calculations or create date-based charts and graphs.
You can learn more about the
SECOND Google Sheets function on Google Support.