Date and Time Functions in Excel
1. TODAY()
Syntax: =TODAY()
Description: Returns the current date.
Example:
=TODAY()
Result: If today’s date is February 10, 2025, it will display 02/10/2025.
2. NOW()
Syntax: =NOW()
Description: Returns the current date and time.
Example:
=NOW()
Result: If the current date and time is February 10, 2025, 12:30 PM, it will
display 02/10/2025 12:30:00 PM.
3. DATE(year, month, day)
Syntax: =DATE(year, month, day)
Description: Returns the date based on the specified year, month, and day.
Example:
=DATE(2025, 2, 10)
Result: 02/10/2025.
4. TIME(hour, minute, second)
Syntax: =TIME(hour, minute, second)
Description: Returns the time based on the specified hour, minute, and second.
Example:
=TIME(14, 30, 0)
Result: 2:30:00 PM.
5. DAY(serial_number)
Syntax: =DAY(serial_number)
Description: Returns the day of the month from a given date.
Example:
=DAY("02/10/2025")
Result: 10.
6. MONTH(serial_number)
Syntax: =MONTH(serial_number)
Description: Returns the month from a given date.
Example:
=MONTH("02/10/2025")
Result: 2 (for February).
7. YEAR(serial_number)
Syntax: =YEAR(serial_number)
Description: Returns the year from a given date.
Example:
=YEAR("02/10/2025")
Result: 2025.
8. DATEDIF(start_date, end_date, unit)
Syntax: =DATEDIF(start_date, end_date, unit)
Description: Returns the difference between two dates in specified units (e.g.,
years, months, days).
Units:
o "Y": Years
o "M": Months
o "D": Days
o "MD": Difference in days, ignoring months and years
o "YM": Difference in months, ignoring years
o "YD": Difference in days, ignoring years
Example:
=DATEDIF("02/10/2020", "02/10/2025", "Y")
Result: 5 (5 years).
9. EDATE(start_date, months)
Syntax: =EDATE(start_date, months)
Description: Returns the date that is a specified number of months before or
after a given date.
Example:
=EDATE("02/10/2025", 6)
Result: 08/10/2025 (6 months after).
10. TEXT(value, format_text)
Syntax: =TEXT(value, format_text)
Description: Converts a value to text in a specified format.
Example:
=TEXT("02/10/2025", "dddd, mmmm dd, yyyy")
Result: Monday, February 10, 2025.