DAY function

Excel DAYS Function allows you to calculate the number of days between two dates, making it easy to determine the duration between them.

Syntax

DAYS(end_date, start_date)

Arguments

end_dateThe end date in the calculation. This is typically the later date.
start_dateThe start date in the calculation. This is typically the earlier date.

How to use

You can use the DAYS function in Excel to find the number of days between two dates. Here’s how to use it:

Here’s a simple example:

If you have an end date in cell A1 (e.g., 2023-11-30) and a start date in cell B1 (e.g., 2023-11-01), you can use the following formula:

This formula will give you the result of 29, indicating that there are 29 days between the two dates.

It’s important to remember that the end date should be later than the start date for this function to work correctly. If you reverse the order of the dates, the result will be negative.

Additionally, you can use this function to calculate the number of days until a future event or the number of days since a past event by adjusting the order of the dates accordingly.

Examples

Let’s look at a few more examples:

1. To calculate the number of days until a future event (end date in the future), use the following formula:

This will result in 60 days.

2. To calculate the number of days since a past event (end date in the past), use the following formula:

This will result in 31 days.

3. You can also reference cell values instead of date strings in the formula. If you have the end date in cell A1 and the start date in cell B1, you can use:

Assuming A1 contains 2023-12-31 and B1 contains 2023-11-01, the result will be 60 days.

Additional information

The DAYS function in Excel is a handy tool for calculating the duration between two dates, making it useful for various tasks such as tracking project timelines, calculating age, or planning events. It’s important to ensure that the dates are correctly formatted and that the end date is after the start date to obtain accurate results.

Tomasz Decker is an Excel specialist, skilled in data analysis and financial modeling.