Ask Your Question

how to calculate date difference [closed]

asked 2014-02-13 07:44:03 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-19 10:42:23.818562

1 Answer

Sort by » oldest newest most voted

answered 2014-02-13 08:22:23 +0200

razon_22 gravatar image

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


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

edit flag offensive delete link more


it throwing error #VALUE!

Ram.BM gravatar imageRam.BM ( 2014-02-13 08:33:16 +0200 )edit

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.

razon_22 gravatar imagerazon_22 ( 2014-02-13 08:40:17 +0200 )edit

Question Tools

1 follower


Asked: 2014-02-13 07:44:03 +0200

Seen: 3,141 times

Last updated: Feb 13 '14