# Calculating Number of Days between two dates

#### Princessboko

##### Board Regular
I need to calculate the number of days between a start date and a stop date. I thought that there was a function in Excel that would help with that "DATEDIF" but don't see it.

This message was edited by Princessboko on 2002-11-04 19:55

### Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

#### Princessboko

##### Board Regular
On 2002-11-04 19:54, Princessboko wrote:
I need to calculate the number of days between a start date and a stop date. I thought that there was a function in Excel that would help with that "DATEDIF" but don't see it.

This message was edited by Princessboko on 2002-11-04 19:55

#### maxflia10

##### Well-known Member
=datedif(a1,b1,"d")
where a1 houses a start date and b1 an end date

##### MrExcel MVP
"...but don't see it"

datedif is an available function in all excel versions, but is only documented by 2000 & above. For reference, here's the help file:

<pre>

Calculates the number of days, months, or years between two dates.
This function is provided for compatibility with Lotus 1-2-3.

Syntax

DATEDIF(start_date,end_date,unit)

Start_date is a date that represents the first, or starting, date of the period.
Dates may be entered as text strings within quotation marks (for example, "2001/1/30"),
as serial numbers (for example, 36921, which represents January 30, 2001,
if you're using the 1900 date system), or as the results of other formulas or functions
(for example, DATEVALUE("2001/1/30")). For more information about date serial numbers, see NOW.

End_date is a date that represents the last, or ending, date of the period.

Unit is the type of information you want returned.

Unit Returns
"Y" The number of complete years in the period.
"M" The number of complete months in the period.
"D" The number of days in the period.
"MD" The difference between the days in start_date and end_date.
The months and years of the dates are ignored.
"YM" The difference between the months in start_date and end_date.
The days and years of the dates are ignored.
"YD" The difference between the days of start_date and end_date.
The years of the dates are ignored.

Remarks

Microsoft Excel stores dates as sequential serial numbers so that it can perform calculations on them.
Excel stores January 1, 1900, as serial number 1 if your workbook uses the 1900 date system.
If your workbook uses the 1904 date system, Excel stores January 1, 1904, as serial number 0
(January 2, 1904, is serial number 1). For example, in the 1900 date system, Excel stores January 1,
1998, as serial number 35796 because it is 35,795 days after January 1, 1900.
Learn more about how Microsoft Excel stores dates and times.

Excel for Windows and Excel for the Macintosh use different date systems as their default.
Examples

DATEDIF("2001/1/1","2003/1/1","Y") equals 2, or two complete years in the period.

DATEDIF("2001/6/1","2002/8/15","D") equals 440, or 440 days between June 1, 2001,
and August 15, 2002.

DATEDIF("2001/6/1","2002/8/15","YD") equals 75, or 75 days between June 1 and August 15,
ignoring the years of the dates.

DATEDIF("2001/6/1","2002/8/15","MD") equals 14, or the difference between 1 and 15 —
the day of start_date and the day of end_date — ignoring the months and the years of the dates.

</pre>

#### Mark W.

##### MrExcel MVP
On 2002-11-04 19:54, Princessboko wrote:
I need to calculate the number of days between a start date and a stop date. I thought that there was a function in Excel that would help with that "DATEDIF" but don't see it.

This message was edited by Princessboko on 2002-11-04 19:55

You don't need DATEDIF to subtract dates...

="11/1/02"-"11/5/02"

...or...

=A1-B1

...where cells A1 and B1 contain date values.

See the Excel Help topic for "Tips on entering dates and times".
This message was edited by Mark W. on 2002-11-05 19:48

Replies
7
Views
93
Replies
2
Views
839
Replies
2
Views
185
Replies
3
Views
599
Replies
2
Views
47

1,147,823
Messages
5,743,409
Members
423,792
Latest member
travisds

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Which adblocker are you using?

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back