How to calculate the number of days in Excel
In this post, we are going to show you 5 different methods to count days between two Dates in Excel. They are: Let us have a detailed look at all the above methods.
1] Using Subtraction
Subtraction is the easiest way to count days between two dates in Excel. You can use the arithmetic operator – (minus sign) to subtract one date from another to find the number of days between them. Let’s say we have an Excel sheet with some sample dates listed in two columns, Column A and Column B. The dates in Column B precede the dates in Column A. The third column, Column C, will display the count of days when we subtract the value of Column A from the value of Column B, for each row in the spreadsheet. The following steps describe the process in detail: Note: While using Subtraction, always write the End Date before the Start Date.
2] Using the DAYS function
DAYS is a date function in Excel that calculates the difference between two given dates in days. It can recognize dates passed as ‘strings’ if they can be parsed as valid dates in Excel. Syntax
end_date is the last date providedstart_date is the first date provided
Now for the same example described above, we can use the DAYS formula to count the days as follows: Tip: If your accounting system is based on a 360-day year (twelve 30-day months), you may use the DAYS360 function to count the number of days.
3] Using the DATEDIF function
The DATEDIF function is an advanced version of the DAYS function. It calculates the difference between two date values based on a specified interval, such as days, months, or years. It is useful in formulas that involve age-based calculations. Syntax
start_date is the first or start date of the given period.end_date is the last date of the given period.unit is the information that you would like to get. For example, if you want the DATEDIF function to calculate the number of days, you can enter D in place of the unit. Similarly, you can enter M for months and Y for years. You can also enter a combination of two units, such as YM. This will calculate the difference in months, ignoring the years and the days.
Now taking the same example as above, follow these steps to use the DATEDIF function to count days in Excel: Also Read: How to count words in Microsoft Excel.
4] Using the NETWORKDAYS function
NETWORKDAYS is another useful function through which you can use Excel to find days between two dates. It calculates the number of whole working days between two given dates. While calculating the number of days between two given dates, it automatically excludes the weekends (Saturday, Sunday) and optionally excludes any other holidays provided as dates (state, federal, and floating holidays). Syntax
start_date argument takes the value of the start date.end_date argument takes the value of the end date.[holidays] is a reference to one or dates to be counted as non-working days.
Now let’s say we provide a list of holidays (other than weekends) for the same set of dates as shown in the above example. We can use the NETWORKDAYS function to calculate working days between the given dates as follow: Notes:
5] Using the TODAY function
The TODAY function can be used to calculate the number of days between a past date or a future date, and the current date. By default, it returns the current date (if the cell format is set to General). Syntax Let’s say the current date is 28 September 2022. And we have the date value 04 September 2022 in cell A17 and the date value 30 September 2022 in cell A18. To calculate the number of days between today and 04 September 2022 (which is a past date), we will use the formula =TODAY()-A17. The function returns 24 as the resultant value. Similarly, to calculate the number of days between today and 30 September 2022 (which is a future date), we will use the formula =A18-TODAY(). The function returns 2 as the resultant value. That’s it! Hope you enjoyed knowing these easy tips to use Excel to count days between two dates. Do let us know in the comments if you have any questions.
What is the formula to calculate days?
Multiple Excel formulas can be used to calculate the days between 2 given dates. These include DAYS, DATEDIF, NETWORKDAYS, and TODAY functions. To know how these functions can be used to count days, refer to the above post. You may also use the Subtraction operator (-) to count days between two dates, as explained in this post.
How do I count days from a date in Excel?
There are five ways to count days from a date in Excel. For example, you can use the simple subtraction method to get the job done. However, if it doesn’t work, you can use the DAYS, DATEIF, NETWORKDAYS, or TODAY function as well. For your information, these functions work on Excel, Excel Online, and Google Sheets. Read Next: How to multiply numbers in Single or Multiple cells in Excel.