What is DAYS function in Excel?
Syntax of DAYS function
The DAYS function syntax has the following arguments.
- End_date Required. Start_date and End_date are the two dates between which you want to know the number of days.
- Start_date Required. Start_date and End_date are the two dates between which you want to know the number of days.
Note: Excel stores dates as sequential serial numbers so that they can be used in calculations. By default, Jan 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39447 days after January 1, 1900.
DAYS formula explanation
- If both date arguments are numbers, DAYS uses EndDate–StartDate to calculate the number of days in between both dates.
- If either one of the date arguments is text, that argument is treated as DATEVALUE(date_text) and returns an integer date instead of a time component.
- If date arguments are numeric values that fall outside the range of valid dates, DAYS returns the #NUM! error value.
- If date arguments are strings that cannot be parsed as valid dates, DAYS returns the #VALUE! error value.
Example of DAYS function
Steps to follow:
1. Open a new Excel worksheet.
2. Copy data in the following table below and paste it in cell A1
Note: For formulas to show results, select them, press F2 key on your keyboard and then press Enter.
You can adjust the column widths to see all the data, if need be.
|=DAYS(“3/15/11″,”2/1/11”)||Finds the number of days between the end date (3/15/11) and end date (2/1/11). When you enter a date directly in the function, you need to enclose it in quotation marks. Result is 42.||42|
|=DAYS(A2,A3)||Finds the number of days between the end date in A2 and the start date in A3 (364).||364|