ElyxAI
formulas

How to How to Use DAYS Function in Excel

Excel 2013Excel 2016Excel 2019Excel 365

Learn how to use the DAYS function to calculate the number of days between two dates in Excel. This tutorial covers syntax, practical applications, and real-world examples for project tracking, age calculations, and deadline management. Master this essential date function to streamline time-based calculations.

Why This Matters

The DAYS function is essential for project managers, accountants, and HR professionals who need to calculate durations, track deadlines, and analyze time-based data efficiently.

Prerequisites

  • Basic Excel knowledge and familiarity with cell references
  • Understanding of date formats in Excel (mm/dd/yyyy or dd/mm/yyyy)

Step-by-Step Instructions

1

Open Excel and select a cell

Launch Excel and click on any empty cell where you want the result to appear (e.g., cell C1).

2

Enter the DAYS function syntax

Type the formula: =DAYS(end_date, start_date). Replace end_date and start_date with your date values or cell references (e.g., =DAYS(C2, C1)).

3

Input your dates

Ensure your dates are properly formatted in Excel cells or use DATE functions. Example: =DAYS(DATE(2024,12,31), DATE(2024,1,1)) or =DAYS(C2, C1) if dates are in columns C.

4

Press Enter to execute

Hit Enter to calculate the difference; Excel returns the number of days between the two dates as a positive or negative integer.

5

Copy the formula to other cells

Select the cell with the formula, copy it (Ctrl+C), then select the range where you need it and paste (Ctrl+V) to apply it to multiple rows.

Alternative Methods

Subtraction method

Subtract dates directly using =(end_date - start_date). This works in Excel but is less explicit than DAYS function.

NETWORKDAYS function

Use =NETWORKDAYS(start_date, end_date) to calculate business days only, excluding weekends and holidays.

Tips & Tricks

  • Always place the end date first and start date second in the DAYS function for intuitive positive results.
  • Use consistent date formatting (mm/dd/yyyy or dd/mm/yyyy) throughout your spreadsheet to avoid errors.
  • Combine DAYS with other functions like IF or IFERROR to handle edge cases and invalid dates gracefully.

Pro Tips

  • Use named ranges for your date cells (Data > Define Names) to make formulas more readable: =DAYS(end_date_range, start_date_range).
  • Combine DAYS with SUMPRODUCT to count total days across multiple projects or date ranges in a single formula.
  • Create a helper column with DAYS to quickly identify overdue tasks by checking if the result exceeds expected durations.

Troubleshooting

Formula returns #VALUE! error

Ensure both cell references contain valid dates formatted as dates in Excel. Check that cells aren't text-formatted by using Format Cells > Number tab.

Getting negative numbers instead of positive

Reverse your date order: the function subtracts the second argument from the first, so =DAYS(end_date, start_date) gives positive results.

Results appear as decimals or time values

Right-click the result cell, select Format Cells > Number > Number category, and set decimal places to 0 for whole days.

Related Excel Formulas

Frequently Asked Questions

What is the syntax of the DAYS function?
The syntax is =DAYS(end_date, start_date). It returns the number of days between two dates, with end_date minus start_date. Both arguments can be date values, cell references, or DATE functions.
Can DAYS function handle time values (hours, minutes)?
No, DAYS only calculates full days and ignores time components. If you need to include hours or minutes, use simple subtraction (end_date - start_date) which returns a decimal value.
How do I calculate days including weekends and holidays?
Use the DAYS function for all calendar days. If you need to exclude weekends and holidays, use NETWORKDAYS instead (=NETWORKDAYS(start_date, end_date, [holidays])).
What Excel versions support the DAYS function?
DAYS is available in Excel 2013 and later, including Excel 2016, 2019, and Excel 365 (Microsoft 365). It's not available in Excel 2010 or earlier.

This was one task. ElyxAI handles hundreds.

Sign up