## How to calculate the number of years between dates

The image above demonstrates the DATEDIF function calculating the number of complete years between two dates. Column B and column C contains random dates.

Formula in cell D3:

Copy cell D3 and paste to cells below. The DATEDIF function requires the start date to be less than (earlier than) the end date, the function returns #NUM if not. It is the third argument that determines which unit to use. "Y" is the abbreviation for the year unit.

Note that the DATEDIF function does not appear when you start typing the function, however, it is there don't worry. The same thing happens when you start typing the arguments, you get no guidance from Excel.

* Why can't I divide the number of days between dates with 365?*Some years are leap years and those years have 366 days.

### Dates basic formulas category

Shannon asks:I need a formula that if I enter a start date in field B1 such as 6/8/11 it will […]

The formula in cell C3 calculates the last date for the given month and year in cell B3. =DATE(YEAR(B3), MONTH(B3)+1, […]

This article demonstrates Excel formulas that calculate complete weeks between two given dates and weeks and days between two given […]

### Excel categories

### One Response to “How to calculate the number of years between dates”

### Leave a Reply

### How to comment

**How to add a formula to your comment**

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

**How to add VBA code to your comment**

[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org or imgur

Paste image link to your comment.

**Contact Oscar**

You can contact me through this contact form

Trying to use excel for training matrix, so want to know how to get notification of when date is due using conditional formatting