Day 16: Date & Time Functions
5 questions · Excel Interview Preparation
What are the key date functions in Excel and what do they return?
TODAY() returns today's date (updates daily). NOW() returns current date and time. YEAR(date), MONTH(date), DAY(date) extract year, month, day as numbers. WEEKDAY(date,2) returns 1=Monday to 7=Sunday (mode 2 is ISO standard). WEEKNUM(date) returns the week number of the year. EOMONTH(date,0) returns the last day of the month. These are the building blocks for all date-based analysis.
How do you calculate the number of working days between two dates?
NETWORKDAYS(start_date, end_date, [holidays]) counts working days (Monday–Friday) between two dates, inclusive of both. An optional holidays range excludes those dates. NETWORKDAYS.INTL allows custom weekend definitions — e.g. for businesses that work on Saturdays: NETWORKDAYS.INTL(start,end,11) where 11 means only Sunday is the weekend. This is commonly used for SLA calculations, delivery time analysis, and project duration.
What is DATEDIF and why is it undocumented?
DATEDIF(start_date, end_date, unit) calculates the difference between two dates in years, months, or days. Units: "Y"=complete years, "M"=complete months, "D"=total days, "YM"=months ignoring years, "MD"=days ignoring months and years. Classic use: =DATEDIF(BirthDate, TODAY(), "Y") calculates exact age in complete years. DATEDIF is intentionally undocumented in Excel (inherited from Lotus 1-2-3) — it works but Microsoft does not officially support it. Use YEARFRAC for year fractions.
How do you extract the month name from a date?
Three approaches: (1) =TEXT(A2,"MMMM") returns full month name ("August"). (2) =TEXT(A2,"MMM") returns abbreviated name ("Aug"). (3) =MONTH(A2) returns the month number (8) — use this when you need to sort or calculate, not display. Important: TEXT returns text, so you cannot sort month names alphabetically with TEXT — they sort alphabetically (April, August...) not chronologically. Use MONTH number for sorting, TEXT for display.
How do you calculate a date that is N business days from today?
WORKDAY(start_date, days, [holidays]) returns a date that is exactly N working days after (positive) or before (negative) the start date. =WORKDAY(TODAY(), 5) returns the date 5 business days from today. =WORKDAY(TODAY(), -10) returns 10 business days ago. WORKDAY.INTL allows custom weekends. Useful for: calculating when a deliverable is due given a business-days SLA, finding the date N days back for reporting windows.
Want 1:1 Excel coaching?
Join EVIKA Academy for live Excel training, real projects, and placement support in Delhi NCR.
Book Free Demo →