DAYS Function (2024)

Calculate the number of days between two dates

Written byCFI Team

Over 1.8 million professionals use CFI to learn accounting, financial analysis, modeling and more. Start with a free account to explore 20+ always-free courses and hundreds of finance templates and cheat sheets. Start Free

What is the DAYS Function?

The DAYS Function[1] in Excel is a Date/Time function that is used for calculating the number of days between two dates. The DAYS function was introduced in MS Excel 2013. Its purpose is to provide the days between two dates. Prior to this, we used End date-Start date.

Key Highlights

  • The DAYS function in Excel is a formula designed to compute the count of days between two given dates.
  • The syntax for the function is “=DAYS(end_date, start_date).” Therefore, the end date is specified as the first argument in the formula, and the start date is specified as the second argument in the formula.
  • When both arguments are numbers, the DAYS function will use Enddate-Startdate to calculate the number of days between both dates.

Formula for the DAYS Function

=DAYS (end_date, start_date)

The function requires two arguments: Start_date and End_date. They are the two dates between which we wish to calculate the number of days.

How to use the DAYS Function in Excel?

It is a built-in function that can be used as a worksheet function in Excel. Let’s take an example. We are given the two dates below:

DAYS Function (1)

So here we would use the formula =DAYS(C5,B5)

DAYS Function (2)

Using the formula above, we would get the result below:

DAYS Function (3)

Examples of the DAYS Function in Excel

To understand the uses of the DAYS function, let’s consider a few examples:

Example 1

Let’s assume we have entered dates that are not in order. In that scenario, we can use the DAYS function as follows. Using the data below, when we use DAYS, we would get a negative value.

DAYS Function (4)

In such a scenario, the DAYS function can be used along with ABS function as shown below:

DAYS Function (5)

We will get the result below:

DAYS Function (6)

Using the ABS function, the result will always be a positive number regardless of the order in which dates are entered as parameters in the DAYS function.

Example 2

Let’s assume we have a business that provides debtors a 90-day credit period. As an analyst, we have been given information about the day on which customer entered into a contract and we need to calculate and see if 90 days have been completed or not as of today. The data is given as below:

DAYS Function (7)

Let’s see how DAYS function can be used:

First, we shall use the TODAY function to find out the date as of today.

DAYS Function (8)

After that, in column D, we will use the DAYS Function and find out how much time has passed since the goods were sold to the customers.

DAYS Function (9)

DAYS Function (10)

Example 3

Let’s see how the DAYS function works in different scenarios. The function helps to create more complex calculations with dynamic variables. Let’s see how using the data provided below.

DAYS Function (11)

Now we are given the data in column B to Column D. We need to look up for the date given in A2 and also calculate the number of days from 3/12/2013. In this scenario, we can calculate using the formula =DAYS(VLOOKUP(A2,B2:D4,1, FALSE),B2) as shown below:

DAYS Function (12)

The above formula would look up for December 3, 2015, in the array of data and then calculate the number of days from December 3, 2013,.

Things to remember about the DAYS Function

Tip #1

When both arguments are numbers, the DAYS function will use Enddate-Startdate for calculating the number of days between both dates as shown below.

DAYS Function (13)

Remember that Excel converts each date into a number and then does the calculations. Excel accepts dates from 1900 to 10000 years. If we wish to see the dates, the above numbers pertain to:

DAYS Function (14)

Tip #2

When any one of the arguments is text, the argument is treated as DATEVALUE(date_text). In this scenario, it will return an integer date instead of a time component.

Tip #3

The #NUM! error would occur when the numerical value given for a date argument is outside the range of valid dates. For example:

DAYS Function (15)

Tip #4

The #VALUE! error is returned when one of the date arguments is a string that is not described as a valid date.

DAYS Function (16)

Tip #5

The #NAME? error is returned when the syntax used in the formula is incorrect.

Click here to download the sample Excel file

Additional Resources

Thanks for reading CFI’s guide to important Excel functions! By taking the time to learn and master these functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources:

Article Sources

  1. DAYS Function
DAYS Function (2024)

FAQs

How to use days function in Excel? ›

The DAYS function in Excel is a formula designed to compute the count of days between two given dates. The syntax for the function is “=DAYS(end_date, start_date).” Therefore, the end date is specified as the first argument in the formula, and the start date is specified as the second argument in the formula.

What is the meaning of day function? ›

The DAY Function is useful for financial analysts as it returns the day of a date, represented by a serial number. The day is given as an integer ranging from 1 to 31.

What is the purpose of day () function? ›

b) Day(): The Day() function is used to extract and display the day of the month from a given date. It takes a date as input and returns the numeric day value, such as 1 for the first day of the month.

What is the day function in Excel format? ›

The DAY function takes just one argument, the date from which you want to extract the day. In the example, the formula is: =DAY(B5) B5 contains a date value for January 5, 2016. The DAY function returns the number 5 representing the day component of the date.

How do I calculate days between two dates? ›

To calculate the number of days between two dates, you need to subtract the start date from the end date.

How do I use the days formula in Excel today? ›

Example
FormulaDescriptionResult
=DATEVALUE("1/1/2030")-TODAY()Returns the number of days between the current date and 1/1/2030. Note that cell A4 must be formatted as General or Number for the result to display correctly.1/31/1918
=DAY(TODAY())Returns the current day of the month (1 - 31).1
3 more rows

How to write a day formula in Excel? ›

Here's how:
  1. Let's assume that the original date is in cell A3.
  2. In another cell (let's say B3), enter one of these formulas: To return the full name of the day such as "Monday" or "Tuesday", the formula is: =TEXT(A3, "dddd") ...
  3. Press Enter, and cell B3 will display the day name corresponding to the date in cell A3.
Oct 18, 2023

What is the formula for working days in Excel? ›

=WORKDAY(start_date, days, [holidays])

The function uses the following arguments: Start_date (required function) – This is a date that represents the start date. Days (It is a required function) – The number of workdays to be added to start_date.

How to calculate days between two dates in Excel? ›

To find the number of days between these two dates, you can enter “=B2-B1” (without the quotes into cell B3). Once you hit enter, Excel will automatically calculate the number of days between the two dates entered. Note that Excel recognizes leap years.

How do I add days in Excel? ›

Add or subtract days from a date
  1. Enter your due dates in column A.
  2. Enter the number of days to add or subtract in column B. You can enter a negative number to subtract days from your start date, and a positive number to add to your date.
  3. In cell C2, enter =A2+B2, and copy down as needed.

How do you use day ()? ›

Sample usage

DAY(TODAY()) + 1 returns tomorrow's day of the month. DAY(TODAY()) - 1 returns yesterday's day of the month. DAY([Birthday]) returns someone's birthday day of the month.

How to get days name in Excel? ›

Format cells to show dates as the day of the week

Under Category, click Custom, and in the Type box, type dddd for the full name of the day of the week (Monday, Tuesday, and so on), or ddd for the abbreviated name of the day of the week (Mon, Tue, Wed, and so on).

What is the day function in spreadsheets? ›

What does the DAY Function do in Google Sheets? The DAY function returns the day from a given date. The DAY function is beneficial when extracting the day from a specific date. For instance, the DAY formula is helpful when you need to know the revenue per day in a month for three months, regardless of the month.

What is the day function in Microsoft? ›

Returns a Variant (Integer) specifying a whole number between 1 and 31, inclusive, representing the day of the month. The required dateargument is any Variant, numeric expression, string expression, or any combination of these that can represent a date. If date contains Null, Null is returned.

What is the day code in Excel? ›

Example
Data
FormulaDescription (Result)Result
=WEEKDAY(A2)Day of the week, with numbers 1 (Sunday) through 7 (Saturday) (5)5
=WEEKDAY(A2, 2)Day of the week, with numbers 1 (Monday) through 7 (Sunday) (4)4
=WEEKDAY(A2, 3)Day of the week, with numbers 0 (Monday) through 6 (Sunday) (3)3
1 more row

How do I add 7 days to a date in Excel? ›

Add or subtract days from a date
  1. Enter your due dates in column A.
  2. Enter the number of days to add or subtract in column B. You can enter a negative number to subtract days from your start date, and a positive number to add to your date.
  3. In cell C2, enter =A2+B2, and copy down as needed.

Top Articles
Latest Posts
Article information

Author: Cheryll Lueilwitz

Last Updated:

Views: 6280

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Cheryll Lueilwitz

Birthday: 1997-12-23

Address: 4653 O'Kon Hill, Lake Juanstad, AR 65469

Phone: +494124489301

Job: Marketing Representative

Hobby: Reading, Ice skating, Foraging, BASE jumping, Hiking, Skateboarding, Kayaking

Introduction: My name is Cheryll Lueilwitz, I am a sparkling, clean, super, lucky, joyous, outstanding, lucky person who loves writing and wants to share my knowledge and understanding with you.