Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How To Remove Duplicates In Excel Column Or Row?
  • Excel Pie Chart
  • Excel Line Chart
  • Add Outline to Data in Excel
  • How to Create Area Chart in Excel

References

  • How to get last row in text data in Excel
  • Last row number in range
  • Basic INDEX MATCH approximate in Excel
  • To count total rows in a range in Excel
  • How to use Excel ROW Function

Data Validations

  • Excel Data validation require unique number
  • Excel Data validation allow weekday only
  • How To Create Drop-down List in Excel
  • Excel Data validation date in next 30 days
  • Excel Data validation allow uppercase only

Calculate years between dates in Excel

by

If you want to calculated the number of years between two dates,  then this tutorials is for you. See example below;

To calculated the number of years between two dates, you can use the YEARFRAC function, which will return a decimal number representing the fraction of a year between two dates. Here are a few examples of the results that YEARFRAC calculates:

Formula

=YEARFRAC(start_date,end_date)

Explanation

Note: The YEARFRAC function has an optional 3rd argument that controls how days are counted when computing fractional years. The default behavior is to count days between two dates based on a 360-day year, where all 12 months are considered to have 30 days. The YEARFRAC page provides more information.

Start date End date YEARFRAC result
1/1/2015 1/1/2016 1
3/15/1970 9/15/1976 6.5
1/1/2000 7/15/2000 .5389
6/1/2000 6/25/1999 .9333

Once you have the decimal value, you can round the number if you like. For example, you could round to the nearest whole number:

=ROUND(YEARFRAC(A1,B1),0)

You might also want to keep only the integer portion of the result with no fractional value, so that you are only counting whole years. In that case, you can just wrap YEARFRAC in the INT function:

=INT(YEARFRAC(A1,B1))

Post navigation

Previous Post:

COSH function: Description, Usage, Syntax, Examples and Explanation

Next Post:

Excel Data validation require unique number

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • How to use Excel OR Function
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • Excel If, Nested If, And/Or Criteria Examples
  • Complete List of Excel Logical Functions, References and Examples
  • TRUE function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • YEAR function: Description, Usage, Syntax, Examples and Explanation
  • Convert Excel time to decimal seconds
  • Dynamic date list in Excel
  • Check If Two Dates are same month in Excel
  • Convert Excel time to decimal minutes

Grouping

  • Calculate conditional mode with criteria in Excel
  • Group numbers with VLOOKUP in Excel
  • Running count group by n size in Excel
  • Categorize text with keywords in Excel
  • Group numbers at uneven intervals in Excel

General

  • Basic text sort formula in Excel
  • How to Create Calendar in Excel
  • How to Insert Cells, Row and Rows in Excel
  • How to calculate percentage of total in Excel
  • Hide and Unhide Columns or Rows in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning