Mastodon Mastodon
Excel Functions

How to Use Excel DAYS Function?

DAYS Function in Excel Returns the Difference in Days between Two Dates, ignoring time!

Excel DAYS Function Example
Excel DAYS Function Example

DAYS Function: A Brief

DAYS function in Excel is used to calculate the number of days between two dates. If you have a start date in cell A1 and an end date in cell B1, the formula =DAYS(B1, A1) will return the total number of days between those two dates.

If your system uses the mm/dd/yy date format but your formula uses a different format like dd/mm/yyyy, Excel may show a #VALUE! error. This happens because the date format in the formula doesn’t match your system’s date setting, causing Excel to misread the date.

ObjectiveValue Returned by function
Aim to return days between two dates in numberDAYS Function will extract & return the number of days between the Ending date and the Starting date.

DAYS Function: A Syntax

=DAYS(end_date, start_date)
  • end_date: The later date.
  • start_date: The earlier date.

Note: The result will be a positive or negative number depending on the order of dates.

Function Compatibility:

The DAYS function was introduced in Excel 2013. It is supported in all modern versions of Excel, including Excel 2013, 2016, 2019, and Microsoft 365. If you are using older versions of Excel, then you might need to use the formula: =DATEDIF(start_date, end_date, "d").

Basic Example:

S.noEnd DateStart DateFinal ResultFormula UsedComments
112-Mar-2401-Jan-2471 =DAYS(B4,C4)Includes Feb 29, so leap year is considered
205-Jan-2325-Dec-2211 =DAYS(B5,C5) Days between December and January, different years
319-Jun-2101-Aug-21-43 =DAYS(B6,C7)Reversed dates, returns a negative number
403-Oct-2005-Sep-2028 =DAYS(B8,C8)In 2020, a leap year, but Feb not in range
508-May-2301-Jan-23127 =DAYS(B9,C9)Days between two dates in the same year
630-Jun-2215-Jun-2215 =DAYS(B10,C10)Days between two dates in the same month and year
Basic Example of using DAYS Function in Excel
Basic Example of using DAYS Function in Excel

From the above example,

  • The 1st explains that the DAYS function automatically checks whether the given dates include a leap year. If so, it adds one extra day for the month of February.
  • The 2nd shows that the DAYS function can calculate the difference in days between dates that fall in different years.
  • The 3rd explains that if the end date is earlier than the start date, the DAYS function will return a negative value.
  • The 4th shows that even if a leap year is present, the DAYS function will ignore it if February is not within the range of the dates.
  • The 5th explains that the DAYS function can find the difference between two dates in the same year.
  • The 6th shows that the DAYS function can also calculate the difference between two dates within the same month.

In the above example, I’ve tried to cover all the necessary possibilities of using DAYS function in Excel.

Using Other Functions Nested with DAYS Function:

In the below example, I’ve listed the available combinations of using DAYS functions with other Excel functions.

Start DateEnd DateToday’s Date
01 January 202330 June 202401-Apr-25
LabelFormula UsedOutputExplanation
Days Between =DAYS(B7,B4)546How many days from start to end
Days Remaining =DAYS(B7,B10)-275Days left from today until end
Status (Overdue) =IF(DAYS(B10,B7)<0,”Overdue”,”On Time”)On TimeChecks if task is overdue
Duration Text =TEXT(DAYS(B7,B4),”0″) & ” days between start and end”546 days between start and endHuman-friendly sentence showing total days
Subscription Status =IF(DAYS(B10,B4)>365,”Expired”,”Active”)ExpiredActive or Expired based on 365 days check
Months Duration =DATEDIF(B4,B7,”m”)17Calculates full months between dates
Fancy Duration =DATEDIF(B4,B7,”y”) & ” years, ” & DATEDIF(B4,B7,”ym”) & ” months, ” & DATEDIF(B4,B7,”md”) & ” days”1 years, 5 months, 29 daysShows months and leftover days
Using DAYS Function with Other Excel Functions
Using DAYS Function with Other Excel Functions

Thats it.

Vigneshwaran Vijayakumar.

Feel free to comment us below, if you have any queries about the above topic and find more interesting excel tutorials on our homepage: Excel24x7.com.

External References:

  • DAYS function – How to include start and end date by Microsoft TechCommunity, Retrieved on 02/04/2025: Link.
  • I need a formula for calculating days since a date but ignoring blank cells without a date by Reddit Community, Retrieved on 02/04/2025: Link.
  • Calculate the difference between two dates by Microsoft Support, Retrieved on 02/04/2025: Link.
  • Counting the days between two dates using the DAYS function by Youtube Video, Retrieved on 02/04/2025: Link.
  • How To Use The Days ( ) Function In Microsoft Excel To Count Between Two Dates? by Youtube Video, Retrieved on 02/04/2025: Link.
  • How to correct a #VALUE! error in the DAYS function by Microsoft Support, Retrieved on 02/04/2025: Link.

Vigneshwaran Vijayakumar

Hello, I’m Vigneshwaran Vijayakumar, also known as Vikroger, the founder, owner, and author of WinSides.com. With nearly a decade of experience in blogging across various domains and specializing in Windows-related tutorials for over five years, I bring a wealth of knowledge and expertise to WinSides.com. Expanding my expertise, I am now stepping into Excel24x7.com aiming to provide high-quality, in-depth articles that simplify Excel for users of all levels. My goal is to make learning Excel as seamless as possible, offering practical solutions and insights to enhance productivity and efficiency.

Find more about Vigneshwaran!

Back to top button