Calculating Days Between Two Dates in Excel (With Examples)

Excel is a versatile tool with many functions, including date and time arithmetic. Calculating the number of days between two dates is a common task. Whether you're tracking project timelines, scheduling events, or doing financial forecasting, here are seven examples of how you can calculate days between two dates in Excel.

Example 1: Basic Calculation

Excel stores dates as sequential serial numbers, making it easy to calculate the number of days between two dates. Simply subtract the earlier date from the later date. If A1 has the start date and B1 the end date, your formula would be =B1-A1.

  1. Understanding date-based calculations in Excel

Example 2: DATEDIF Function

Excel's DATEDIF function can also calculate the number of days between two dates. The syntax is =DATEDIF(start_date, end_date, "D"). This will return the number of days between the start and end date.

  1. Detailed guide on DATEDIF function

Example 3: NETWORKDAYS Function

To calculate the number of workdays between two dates (excluding weekends), you can use the NETWORKDAYS function. The syntax is =NETWORKDAYS(start_date, end_date).

  1. How to use NETWORKDAYS function

Example 4: NETWORKDAYS.INTL Function

If your workweek doesn't follow the typical Monday-Friday schedule, the NETWORKDAYS.INTL function can be customized to exclude specific days of the week. For example, =NETWORKDAYS.INTL(start_date, end_date, 7) will calculate the number of days excluding Sundays (represented by the number 7).

  1. Getting started with NETWORKDAYS.INTL function

Example 5: Using TODAY Function

If you need to calculate the number of days from a specific date until today, use the TODAY function in combination with a subtraction operation. For example, =TODAY()-A1 will give the number of days between the date in A1 and today.

  1. More about TODAY function

Example 6: Using YEARFRAC Function

If you need to get the fraction of a year between two dates, you can use the YEARFRAC function. The syntax is =YEARFRAC(start_date, end_date). This function can be particularly useful for financial calculations.

  1. In-depth knowledge about YEARFRAC function

Example 7: Calculating Age

If you need to calculate someone's age, you can do so with a combination of the TODAY and INT functions. Use =INT((TODAY()-birthdate)/365.25) where 'birthdate' is the cell containing the person's birth date.

  1. Learning how to calculate age in Excel
Previous
Previous

Changing Chart Colors Based on Value for Better Data Visuals

Next
Next

How to Batch Rename Multiple Hyperlinks in Excel