# How to calculate no of days between dates in excel

## How to Calculate Number of Days between Dates in Excel

If you’re working with dates in Excel, you may need to calculate the number of days between two dates. This can be useful for a variety of purposes, such as tracking the duration of a project or calculating the number of days between a customer’s order and delivery.

To calculate the number of days between two dates in Excel, you can use the DATEDIF function. However, there are several different writing patterns you can use, depending on the specific calculation you need to perform. In this article, we’ll cover the basics of using the DATEDIF function to calculate the number of days between dates, as well as some more complex calculations you can perform with other Excel functions.

### Step 1: Enter the Dates

To calculate the number of days between two dates in Excel, you first need to enter the dates into your spreadsheet. You can do this by selecting the cell where you want to enter the first date and typing in the date in the format of mm/dd/yyyy. You can then repeat this process for the second date.

### Step 2: Calculate the Number of Days

Once you have entered the dates, you can use the DATEDIF function in Excel to calculate the number of days between them. The syntax for the DATEDIF function is: =DATEDIF(start_date, end_date, unit)

### Step 3: Understanding the Units

The ‘unit’ parameter in the DATEDIF function represents the type of interval you want to calculate between the two dates. There are several different units you can use, such as ’d’ for days, ’m’ for months, and ‘y’ for years. To calculate the number of days between two dates, you should use the ’d’ unit.

### Step 4: Using the DATEDIF Function for Calculating Days

To calculate the number of days between two dates using the DATEDIF function, you would enter the following formula into the cell where you want the result to appear: =DATEDIF(A1, B1, ’d’)

### Step 5: Understanding the Results

The result of the DATEDIF function will be the number of days between the two dates you entered. This value will be displayed as a number in the cell where you entered the formula.

### Step 6: Using Negative Numbers for Dates in the Past

If you want to calculate the number of days between two dates in the past, you can use negative numbers for the start date. For example, if you want to calculate the number of days between June 1, 2020, and May 1, 2020, you would enter the formula =DATEDIF(‘6/1/2020’, ‘-5/1/2020’, ’d’)

### Step 7: Calculating the Number of Days with Today’s Date

If you want to calculate the number of days between a date in the past and today’s date, you can use the TODAY function in Excel. The TODAY function returns the current date as a serial number, so you can use it in your formula to calculate the number of days between the past date and today. For example, if you want to calculate the number of days between January 1, 2020, and today’s date, you would enter the formula =DATEDIF(‘1/1/2020’, TODAY(), ’d’)

### Step 8: Calculating the Number of Days with a Future Date

If you want to calculate the number of days between a date in the future and today’s date, you can use the TODAY function and the DATE function together. The DATE function allows you to enter a specific date in the future, and you can use the TODAY function to calculate the number of days between the future date and today. For example, if you want to calculate the number of days between January 1, 2022, and today’s date, you would enter the formula =DATEDIF(‘1/1/2022’, TODAY(), ’d’)

### Step 9: Using the YEAR Function for Dates in Different Years

If you want to calculate the number of days between two dates in different years, you can use the YEAR function in Excel. The YEAR function returns the year of a date as a number, which you can use in your formula to ensure that the calculation is accurate. For example, if you want to calculate the number of days between June 1, 2020, and June 1, 2021, you would enter the formula =DATEDIF(‘6/1/2020’, ‘6/1/2021’, ’d’) + ((YEAR(‘6/1/2021’) - YEAR(‘6/1/2020’)) * 365)

### Step 10: Using the MONTH Function for Dates in Different Months

If you want to calculate the number of days between two dates in different months, you can use the MONTH function in Excel. The MONTH function returns the month of a date as a number, which you can use in your formula to ensure that the calculation is accurate. For example, if you want to calculate the number of days between June 1, 2020, and August 1, 2020, you would enter the formula =DATEDIF(‘6/1/2020’, ‘8/1/2020’, ’d’) + ((MONTH(‘8/1/2020’) - MONTH(‘6/1/2020’)) * 30)

### Step 11: Using the DAY Function for Dates in Different Days

If you want to calculate the number of days between two dates in different days of the month, you can use the DAY function in Excel. The DAY function returns the day of the month as a number, which you can use

Older post