Question

Sample data

column1    
01-JAN-10 
01-jan-90

like so much data is there

I want out put like

column2
31-dec-25
31-dec-15

For this give me formula. I tried like =Year(A1)+15 but it doesn't giving proper output

Was it helpful?

Solution

Here's a solution with LibreOffice Calc:

enter image description here

It uses =DATE(YEAR(A2)+15,12,31) where DATE(<year>,<month>,<day>).

OTHER TIPS

=DATE(YEAR(A1)+15)

You need to use the date function. More information and more example at

http://office.microsoft.com/en-us/excel-help/add-dates-HP003056112.aspx#BMadd_a_number_of_years_to_a_date

This works for excel and LibreOffice Calc

More elegant solution is (using the exact source info above) ...

=Edate(A2,15*12) - 1

Edate will giving you the same date, 15 years on .. so 1 Jan 25, subtract 1 gives you the previous day.

Parameter is months, so either hard code the '15', or for variable number of years, point to a cell.

Also works for leap years ...

If A2 = 29 Feb 2020,

=Edate(A2,12) gives 28 Feb 2021; =Edate(A2,12) + 1 gives 1 Mar 2021

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top