Ever found yourself manually counting days in Excel, only to realize you've made an error or wasted time? It's time to automate this process and save your precious time and effort. In this guide, we'll explore how to automatically count days in Excel using simple yet powerful functions.

Before we dive in, ensure you're familiar with Excel's basic functions and formulas. If you're new to Excel, don't worry - we'll keep it simple and explain each step clearly. Let's get started!

Understanding the DATEDIF Function
The DATEDIF function is your secret weapon for counting days in Excel. It calculates the difference between two dates and returns the result in days, months, or years. We'll focus on the 'days' option for this guide.

Here's the basic syntax of the DATEDIF function: DATEDIF(start_date, end_date, unit). For our purpose, the unit will always be 'd' for days.
Calculating Days Between Two Dates

Let's start with the most basic use case: calculating the number of days between two dates. Assume you have two dates in cells A1 and B1 (e.g., A1 = 01/01/2022, B1 = 12/31/2022). In the cell where you want the result (e.g., C1), enter the following formula:
DATEDIF(A1, B1, "d")
Press Enter, and you'll see the result: 364 days. Easy, right?

Calculating Days Excluding Weekends
What if you want to exclude weekends (Saturday and Sunday) from the count? Excel doesn't have a built-in function for this, but we can create a simple workaround using the NETWORKDAYS function.
Here's the formula to calculate weekdays only: NETWORKDAYS(A1, B1)

This function counts the number of whole workdays between two dates, excluding weekends and holidays. If you want to include holidays, you can list them in a separate range (e.g., C1:C10) and add it to the formula like this: NETWORKDAYS(A1, B1, C1:C10)
Counting Days Until a Future Date




















Now let's explore how to count the number of days until a future date. This is particularly useful for tracking deadlines or milestones.
Assume today's date is in cell A1 (e.g., 01/15/2023) and the future date is in cell B1 (e.g., 03/15/2023). In cell C1, enter the following formula:
=DATEDIF(A1, B1, "d")
This will display the number of days left until the future date. If you want to display the result as a positive number regardless of whether the future date is earlier or later than today's date, you can use an IF statement:
=IF(B1>A1, DATEDIF(A1, B1, "d"), 0)
This formula will return the number of days until the future date if it's later than today's date, and 0 if it's earlier.
Counting Days Since a Past Date
You can also count the number of days since a past date using a similar approach. In cell C1, enter the following formula:
=DATEDIF(B1, A1, "d")
This will display the number of days since the past date. To ensure the result is always positive, use an IF statement:
=IF(A1>B1, DATEDIF(B1, A1, "d"), 0)
And there you have it! You now know how to automatically count days in Excel, whether you're calculating the difference between two dates, excluding weekends, or tracking days until a future or past date. Happy automating!