Lesson 1.6 – Date & Time Functions (TODAY, NOW, DATEDIF, EOMONTH, NETWORKDAYS)
1. Introduction
Excel’s Date & Time Functions help you work with dates, times, deadlines, and schedules.
These functions are widely used in attendance reports, project timelines, salary calculations, and business analytics.
A. TODAY Function
Purpose: Returns the current date (no time).
Syntax:
-
Updates automatically every day.
-
Useful for age calculation, deadlines, and reports.
Example – Calculate Age
(Where A2 contains the birth date)
B. NOW Function
Purpose: Returns the current date and time.
Syntax:
-
Updates automatically when the sheet is recalculated.
-
Useful for timestamps and log entries.
C. DATEDIF Function
Purpose: Calculates the difference between two dates in years, months, or days.
Syntax:
-
Units:
"Y"(years),"M"(months),"D"(days) -
"MD"→ difference in days ignoring months & years -
"YM"→ difference in months ignoring years -
"YD"→ difference in days ignoring years
Example – Years Between Two Dates
D. EOMONTH Function
Purpose: Returns the last day of the month before or after a specified number of months.
Syntax:
-
monthscan be positive or negative.
Example – Last Day of the Current Month
E. NETWORKDAYS Function
Purpose: Returns the number of working days between two dates, excluding weekends and optional holidays.
Syntax:
Example – Working Days Between Two Dates
(Where D2:D5 contains holiday dates)
F. Key Points & Tips
-
Dates in Excel are stored as serial numbers (1 = 1 Jan 1900).
-
If a function returns a number instead of a date, change the cell format to Date.
-
Avoid using text dates; always store dates as valid Excel date values.
Practice Questions – Lesson 1.6
-
Write a formula to find the number of days between two dates in A1 and B1.
-
Find the last day of the month that is 3 months from today.
-
Calculate the working days between 1-Jan-2025 and 31-Jan-2025 excluding weekends and holidays listed in D1:D3.
-
True or False:
NOW()updates automatically without refreshing the sheet.
