Date formulas
Days between dates, working days, ages, month ends, quarters and adding months. 6 answers, each checked by running it, with a live example and an exercise.
How to calculate the number of days between two dates in Excel
=C2-B2Subtract the earlier date from the later one: =C2-B2. Dates are numbers of days, so the difference is the number of days.
How to count working days between two dates in Excel
=NETWORKDAYS(B2,C2,$F$2:$F$3)Use =NETWORKDAYS(start, end, holidays). It counts Monday to Friday, both ends included, and skips any dates listed as holidays.
How to calculate age from a date of birth in Excel
=DATEDIF(B2,$F$1,"y")Use =DATEDIF(birth_date, as_of_date, "y"). It returns completed years, so the age only goes up on the birthday.
How to add months to a date in Excel
=EDATE(B2,C2)Use =EDATE(start_date, months). It moves the date by whole months and handles month ends correctly.
How to get the last day of the month in Excel
=EOMONTH(B2,0)Use =EOMONTH(date, 0). The 0 means this month; 1 is next month and -1 is last month.
How to get the month name from a date in Excel
=TEXT(A2,"mmmm")Use =TEXT(date,"mmmm") for the full name or "mmm" for the short one.