Lesson 4.3 – Date & Time Functions for Data Modeling in Excel
Lesson Overview
Date and time functions are crucial for time-based data analysis. They help calculate durations, deadlines, aging, and schedule-based metrics in data models.
1. TODAY & NOW Functions
1.1 TODAY Function
-
Returns current date
-
Updates automatically every day
-
Syntax:
-
Example:
Show today’s date in a cell:
1.2 NOW Function
-
Returns current date and time
-
Updates automatically with system time
-
Syntax:
-
Example:
Show current timestamp:
2. DATEDIF Function
2.1 Purpose
-
Calculates difference between two dates in days, months, or years
2.2 Syntax
-
unit:
-
“d” = days
-
“m” = months
-
“y” = years
-
2.3 Example
-
Calculate age from birthdate in years:
3. EOMONTH Function
3.1 Purpose
-
Returns last day of a month N months before or after a start date
3.2 Syntax
-
start_date: Reference date
-
months: Positive for future, negative for past
3.3 Example
-
Find last day of next month:
4. NETWORKDAYS Function
4.1 Purpose
-
Calculates number of working days between two dates (excluding weekends and optional holidays)
4.2 Syntax
-
holidays: Optional range of holiday dates
4.3 Example
-
Calculate working days between project start and end:
-
Include holidays from range H2:H10:
5. Tips for Date & Time Functions
-
Ensure date cells are formatted correctly
-
Combine with IF or logical functions for dynamic calculations
-
Use NETWORKDAYS for project planning or payroll calculations
-
Use DATEDIF for age, tenure, or interval calculations
6. Real-Life Examples
-
HR: Calculate employee tenure in years, months, or days
-
Finance: Determine interest calculation periods
-
Project Management: Track working days between milestones
-
Operations: Calculate product aging or delivery timelines
7. Practice Questions
-
Write a formula to show today’s date.
-
Write a formula to show current date and time.
-
Calculate the number of years between a joining date and today using DATEDIF.
-
Find the last day of the current month using EOMONTH.
-
Calculate working days between two dates excluding weekends and holidays.
