views:

100

answers:

1

Hi,

I am needing to calculate the number of years between two fields;

Field A Start Date (dd/mm/yyyy)

Field B End Date (dd/mm/yyyy)

Field C Calc formula display difference between Field A and B in years and months i.e 5.2

Thanks all.

A: 

Assuming you are asking about Calculated Columns then you need the DATEDIF function

Also I am assuming that the 5.2 is 5 years and 2 months - not 5 years and .2 of a year - be a bit more specific in your question and you will get better answers.

So

= DATEDIF([Start Date],[End Date],"Y") 
  & " years and " & 
  DATEDIF([Start Date],[End Date],"YM")
  & " months "

Examples of common formulas

Ryan