DAYS Function – Count Days in Excel, VBA, Google Sheets
Written by
Reviewed by
Download the example workbook
This tutorial demonstrates how to use the DAYS Function in Excel and Google Sheets to count the number of days between dates.
Calculate Number of Days Between Dates
The DAYS Function returns the number of days between two dates.
=DAYS(C3,B3)
It returns a positive number if the end_date is after the start_date (above) or a negative number of the end_date is before the start_date (below):
Absolute Date Difference
To calculate the absolute difference between two dates (no negative values) surround the DAYS Function with the ABS Function:
=ABS(DAYS(C3,B3))
Subtract Dates
Instead of using the DAYS Function, you can usually simply subtract two dates to calculate the number of days between them:
=C3-B3
However, this won’t work with dates stored as text (The DAYS Function will work with dates stored as text.)
Also, this method might return an unexpected result if a time value is stored with the dates. Read our article on calculating the difference between dates to learn more.
Days From Today
To calculate the number of days between a date and Today use the TODAY Function as one of the dates:
=DAYS(TODAY(),B3)
DAYS360 Function
Instead if you need to calculate the number of days between dates using a 360 day year (where each month has 30 days), use the DAYS360 Function:
=DAYS(C3,B3)
=DAYS360(B3,C3)
NETWORKINGDAYS Function
The NETWORKINGDAYS Function will calculate the number of business days between dates:
=NETWORKDAYS(B3,C3)
DAYS in Google Sheets
The DAYS Function works exactly the same in Google Sheets as in Excel:
DAYS Examples in VBA
You can also use the DAYS function in VBA. Type:
Application.Worksheetfunction.Days(End_Date,Start_Date)
For the function arguments, you can either enter them directly into the function, or define variables to use instead.