How to calculate date difference

my file is

   column1        column2
    1-Sep-11	 31-Aug-12
    1-May-12	30-Apr-14
    1-Mar-09	28-Feb-14
    1-Apr-13	31-Mar-14
    1-Apr-10	31-Mar-13

i want how many years difference between column1 and column2

out put like

column1        column2
    1-Sep-11	 31-Aug-12      1
    1-May-12	30-Apr-14       2
    1-Mar-09	28-Feb-14      5
    1-Apr-13	31-Mar-14      1
    1-Apr-10	31-Mar-13      3

please let me know

Put column 1 data in A and column 2 data in B and use this formula in column C

=YEAR(B1)-YEAR(A1)

I tried using the DATEDIF function to accomplish this, but couldn’t get it to work.

it throwing error #VALUE!

It works correctly for me on LO4.2.0.4 and on the nightly builds. What version are you using? Right click on cells in column A, B and C and check the number format. A and B should have Date as the number format and column C should have Number.