Excel DAYS Function

The Excel DAYS function is a built-in function in Microsoft Excel that calculates the number of days between two dates. It can be useful in a variety of applications, such as calculating the length of a project or the number of days until an important event. The function takes two arguments: the end date and the start date, and returns the number of days between them.

DAYS Function Summary

DAYS Purpose

The Excel DAYS function is used to calculate the number of days between two dates.

DAYS Arguments

The DAYS function takes two arguments

  • Start_date (required): This is the starting date of the period for which you want to calculate the number of days. The argument can be entered as a serial number, a date, or a reference to a cell containing a date.
  • End_date (required): This is the ending date of the period for which you want to calculate the number of days. The argument can be entered as a serial number, a date, or a reference to a cell containing a date.

DAYS Return value

The DAYS function returns the number of days between the start_date and end_date.

The result is always a positive number, even if the start_date is greater than the end_date.

DAYS Syntax

The syntax for the Excel DAYS function is as follows:

=DAYS(end_date, start_date)

Note that the order of the arguments is important.

The end_date argument should be entered first, followed by the start_date argument.

In the next section of this blog post, we will explore some practical examples of using the Excel DAYS function.

Excel DAYS Function Examples

Suppose you are planning a trip and want to calculate the number of days between the departure date and the return date.

The departure date is stored in cell A2 and the return date is stored in cell B2.

You can use the DAYS function to calculate the duration of the trip as follows:

=DAYS(B2, A2)

Assuming the departure date is March 15, 2023 and the return date is March 22, 2023, the function would return the value 7, which represents the number of days between these two dates.

Length of A Project Using DAYS

Another example where the DAYS function could be useful is when calculating the length of a project.

Suppose a project starts on January 1, 2023 and is scheduled to end on May 1, 2023.

The duration of the project can be calculated using the following formula:

=DAYS("5/1/2023","1/1/2023")
Length of A Project Using DAYS

The function would return the value 120, which represents the number of days between the start and end dates of the project.

You can also use a cell reference to carry out the function.

Remember that the end date needs to be entered first so the function would look as followed:

=DAYS(B2,A2)
Excel DAYS Function

As you can see we still get the same result when using the cell reference.

Using DAYS When Dates Are Not in Order

Let’s say we have the following date in cell A2 2022-03-15 and the next date in B2 2022-03-10:

Let’s say we have cell A2 with 2022-03-15 and B2 with 2022-03-10.

We want to calculate the number of days between these two dates, but we can’t simply subtract B2 from A2, because the start date is later than the end date.

Instead, we can use the ABS function to return the absolute value of the difference between the two dates, like this:

=ABS(DAYS(A2,B2))
Using DAYS When Dates Are Not in Order

In this example, the DAYS function calculates the difference between the two dates, which is -5 (because the start date is later than the end date).

The ABS function then returns the absolute value of that difference, which is 5.

So, the formula returns a value of 5, which represents the number of days between the two dates, regardless of the order in which they were entered.

This formula can be used to calculate the number of days between any two dates, even if they are not in chronological order.

These examples demonstrate the flexibility and usefulness of the Excel DAYS function, allowing you to calculate the number of days between any two dates for a wide range of applications.

DAYS Notes

  • DAYS function calculates based on the 365-day year, ignoring leap years.
  • Result of the function is always positive.
  • Start_date and end_date arguments must be entered as valid date values.
  • If start_date is later than end_date, use the ABS function to convert the negative value to a positive number.
  • DAYS function can be used with other Excel functions to perform more complex calculations involving date values.

By keeping these notes in mind, you can use the Excel DAYS function more effectively and accurately in your calculations.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top