How to Use the DAYS Function in Excel

The DAYS function in Excel calculates the number of days between two dates, making it essential for tracking timelines and operational performance. In this lesson, you’ll learn how to use the DAYS function to measure time between service and invoicing, identify delays, and create simple flags that highlight whether work is completed on time or late.

Download the Excel file used in this tutorial:

The DAYS Function

1. Understand what the DAYS function is doing

  • The DAYS function calculates the number of days between two dates
  • It subtracts a start date from an end date
  • This gives you a simple numeric result representing elapsed time

2. Test the function with manual dates

  • Enter an end date and a start date directly into the function
  • The function returns the total number of days between those two dates
  • This confirms how the function behaves before applying it to real data

3. Calculate days between service date and invoice date

  • Create a column such as “Days to Invoice”
  • Use the DAYS function with:
    • End date = Invoice date
    • Start date = Service date
  • Fill the formula down to calculate this for all records

This gives you a clear view of how long it takes to invoice each job

4. Create a delay flag using the IF function

  • Define a threshold (for example, 5 days)
  • Use the IF function to classify each record:
    • If days to invoice is greater than the threshold → mark as “Delayed”
    • Otherwise → mark as “On Time”
  • Fill the logic down the column

This creates a simple performance indicator for operational efficiency

5. Analyze performance using AVERAGEIFS

  • Use AVERAGEIFS to calculate average revenue based on invoice status
  • Set:
    • Average range = Revenue column
    • Criteria range = Delay flag column
    • Criteria = “On Time” or “Delayed”
  • Compare the results for each group

This helps you understand how delays impact revenue

6. Summarize results using SUMIF

  • Use SUMIF to total revenue for specific groups (e.g., On Time vs Delayed)
  • This allows you to measure the overall financial impact of delays
  • Compare totals to identify patterns in performance

7. Interpret and apply the results

  • Identify how many jobs are delayed vs on time
  • Measure how delays affect revenue and operations
  • Use the insights to improve invoicing speed and process efficiency

Result

You now have a simple workflow that uses the DAYS function to measure time between events, classify performance, and analyze operational impact using conditional calculations.

The DAYS Function in Excel

Q1. What does the DAYS function do in Excel?
The DAYS function calculates the number of days between two dates by subtracting a start date from an end date. It’s commonly used for tracking durations, delays, and time-based performance metrics.

Q2. Why is the DAYS function useful for business analysis?
Time-based metrics are critical for operational efficiency. The DAYS function helps you measure things like time to invoice, service delays, project timelines, and response times, giving you insight into how efficiently your business operates.

Q3. What is the correct order of dates in the DAYS function?
The function uses the format DAYS(end_date, start_date). The end date comes first, followed by the start date. Reversing the order can result in negative values.

Q4. How can I use DAYS to track delays?
You can calculate the number of days between two events and then compare that value to a threshold (for example, 5 days). This allows you to flag records as “on time” or “delayed”, making it easier to monitor performance.

Q5. Can the DAYS function be combined with other Excel functions?
Yes. The DAYS function is often combined with functions like IF, SUMIF, or AVERAGEIFS to categorize results, analyze delayed vs. on-time performance, and calculate metrics such as average revenue by delay status.

Q6. What are common use cases for the DAYS function?
Typical use cases include tracking invoice turnaround time, delivery delays, project durations, customer response times, and service efficiency metrics across different industries.

Get more lessons like this
by joining our newsletter

Receive weekly Excel tutorials, tips, and KPIs straight to your inbox

Databoards

Analysis & Development