Excel DAYS function
To calculate the number of days between two given dates, the DAYS function in Excel can help you.
The syntax for the DAYS function in Excel is:
Return a number of days between two dates.
Example 1: To calculate the number of days between the start date and end date:
Please enter the below formula into a blank cell to get the number of days between two given dates:
Note: In the above formula, B2 is the end date, and A2 is the start date, please change them to your need.
Example 2: To calculate the number of days between today and another day:
Case 1: Calculate the days from today to deadline:
If you want to count the number of days from the current date till a specific date in future, please apply this formula:
Note: In this formula, A2 is the date of the deadline.
Case 2: Calculate the days from past date to today:
To calculate a number of days from today till a date in the past, please enter this formula:
Note: In this formula, A2 is the past date that you want to calculate the number of days from.
1. If the start date is greater than the end date, the calculated result will be a negative number as following screenshot shown:
In this case, you can combine the ABS function with the DAYS function to get the positive number regardless of which order the dates are entered, please use this formula:
2. You can also replace the cell references in the above formulas with the date text string, such as: