Date & time functions
The 25 date & time functions in Sheets, with the usual names, arguments and results.
| Function | What it does | Syntax |
|---|---|---|
| DATEexample | Date from parts (yyyy-mm-dd) | DATE(year, month, day) |
| DATEDIF | Years, months or days between two dates | DATEDIF(start_date, end_date, unit) |
| DATEVALUE | Date text as a serial number | DATEVALUE(date_text) |
| DAY | Day of the month (1-31) | DAY(date) |
| DAYS | Number of days between two dates | DAYS(end_date, start_date) |
| DAYS360 | Days between dates on a 360-day year | DAYS360(start_date, end_date, [method]) |
| EDATE | Same day N months before or after a date | EDATE(start_date, months) |
| EOMONTHexample | Last day of the month N months away | EOMONTH(start_date, months) |
| HOUR | Hour of a time (0-23) | HOUR(serial_number) |
| ISOWEEKNUM | ISO 8601 week number of a date | ISOWEEKNUM(date) |
| MINUTE | Minute of a time (0-59) | MINUTE(serial_number) |
| MONTHexample | Month of a date (1-12) | MONTH(date) |
| NETWORKDAYSexample | Working days between two dates | NETWORKDAYS(start_date, end_date, [holidays]) |
| NETWORKDAYS.INTL | Working days between dates, custom weekend | NETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays]) |
| NOW | Current date and time | NOW() |
| SECOND | Second of a time (0-59) | SECOND(serial_number) |
| TIME | Time of day from hours, minutes, seconds | TIME(hour, minute, second) |
| TIMEVALUE | Time text as a fraction of a day | TIMEVALUE(time_text) |
| TODAY | Current date | TODAY() |
| WEEKDAY | Day of the week (1-7) | WEEKDAY(date, [type]) |
| WEEKNUM | Week number of a date in its year | WEEKNUM(serial_number, [return_type]) |
| WORKDAY | Date N working days before or after a date | WORKDAY(start_date, days, [holidays]) |
| WORKDAY.INTL | Date N working days away, custom weekend | WORKDAY.INTL(start_date, days, [weekend], [holidays]) |
| YEARexample | Year of a date | YEAR(date) |
| YEARFRAC | Fraction of a year between two dates | YEARFRAC(start_date, end_date, [basis]) |