How to Use DAYS Function in Excel (5 Suitable Examples)

Example 1 – Using Excel DAYS Function to Get Estimated Time

To estimate the total number of days needed to complete the project Steamy Ray from its Start Date and End Date in the sample dataset,

  • Enter the following formula in cell E5.

=DAYS(D5,C5)

Cell D5 has the end date and C5 has the start date.

  • Press Enter.
  • The DAYS function will return the number of days between the two dates.

enter the function

  • Drag the Fill Handle icon to fill the other cells with the formula.

get estimated time


Example 2 – Combine DAYS & ABS Functions to Find Project Completion Date

When counting total days between two days, the DAYS function may return a negative value if you place the earlier date as end_date and the later date as start_date.

To illustrate,

  • Enter the following formula.

=DAYS(C5,D5)

Cell C5 has the Start Date but, in the formula, we put the start date as end_date and D5 has the End Date but in the formula, we put it as start_date.

  • Press Enter.
  • Drag the Fill Handle icon to fill the other cells with the formula.
  • The DAYS function will return the negative number of days between the two dates.

show negative dates

To avoid negative values, use the ABS function with the DAYS function.

  • Enter the following formula.

=ABS(DAYS(C5,D5))

Cell C5 has the Start Date but, in the formula, put the start date as end_date and D5 has the End Date but, in the formula, put it as start_date. Using the ABS function to return the absolute value while ignoring the negative sign.

  • Press Enter.
  • The DAYS function will return the project completion date.

Combine DAYS & ABS Functions to Find Project Completion Date

  • Drag the Fill Handle icon to fill the other cells with the formula.

show the output


Example 3 – Use of DAYS Function to Handle Date Formatted as Text

In the sample dataset below, we’ve formatted the dates as text.

selected dates as formatted text

  • Enter the following formula.

=DAYS(D5,C5)

Cell D5 has the end date and C5 has the start date.

  • Press Enter.
  • The DAYS function will return the number of days between the two dates.

Use of DAYS Function to Handle Date Formatted as Text

  • Drag the Fill Handle icon to fill the other cells with the formula.

Drag the Fill Handle icon


Example 4 – Combine VLOOKUP and DAYS Functions to Get the Number of Days Between Two Dates

  • Enter the following formula.

=DAYS(VLOOKUP(F5,C5:D11,1, FALSE),D5)

In the VLOOKUP function, we have taken cell F5 as lookup_value, the range B5:D11 as table_array, used 1 as col_index_num, and used FALSE as range_lookup to get the Exact Match. It will return the value we’re looking for.

The DAYS function will return the total number of days between the looked_up date which is cell F5 and the date of cell C5.

Cell D5 has the end date and C5 has the start date.

  • Press Enter.
  • The DAYS function will return the number of days between the two dates.

Combine VLOOKUP and DAYS Functions


Example 5 – Use of DAYS & TODAY Functions to find Total Days from Today

  • Enter the following formula.

=DAYS(TODAY(),C5)

  • Press Enter.
  • The DAYS function will return the number of total days from today.

Use of DAYS & TODAY Functions to find Total Days from Today

  • Drag the Fill Handle icon to fill the other cells with the formula.

drag the Fill Handle icon

 


Calculate Number of Days Between Dates in Excel without Days Function

  • Enter the following formula.

=DATEDIF(C5, D5, "d")

  • Press Enter.
  • The DATEDIF function will return the number of days between two dates in Excel.

  • Drag the Fill Handle icon to fill the other cells with the formula.

drag the Fill Handle icon


How to Calculate Working Days Between Two Dates in Excel

  • Enter the following formula.

=NETWORKDAYS(C5, D5)

  • Press Enter.
  • Drag the Fill Handle icon to fill the other cells with the formula.
  • The function will return the number of working days between two dates in Excel.

Calculate Working Days Between Two Dates


Known Errors of DAYS Function in Excel

String Not Recognized as Date

If you use dates as String, you will see the #VALUE error.

Date Out of Valid Range

Using a date outside the valid date, you will see the #NUM error.

Date Out of Valid Range

The valid date range dates from 1900 to 10,000 years.

Misspelling Function Name

Misspelling Function Name


Download to Practice


<< Go Back to Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shamima Sultana
Shamima Sultana

Shamima Sultana, BSc, Computer Science and Engineering, East West University, Bangladesh, has been working with the ExcelDemy project for 2 years. She has written over 75+ articles and reviewed 1000+ articles for ExcelDemy. She has also led several teams with Excel VBA and Content Development works. Currently, she is working as the Project Manager and oversees the day-to-day work, leads the services team, allocates resources to the right area, etc. Her work and learning interests vary from Microsoft... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo