How do I calculate dates?

M

MKChick

I need to be able to add years onto a starting month/year date. For example,
starting with Jan 90, I would need a column that was 7 years more, then a
column that was 10 years more, etc. I've tried all the suggestions in the
"Help" menu, to no avail. Any help out there???
 
N

Nige

Try using Edate - you need the Toolpak addin for this, go to Tools, Addins
and check the Analysis Toolpak checkbox.

=Edate(A1, 84)

will give you 7 years on from the date in cell A1. Edate works using months
rather than years so you'd need to multiply up.

Use =Edate(A1, 84)-1 if you want the result to be the day/month before
that of the start date.
 
D

Don Guillett

one way

Sub addates()
For Each c In Range("e1:e" & Cells(Rows.Count, "e").End(xlUp).Row)
c.Offset(, 1) = DateSerial(Year(c) + 7, Month(c), Day(c))
c.Offset(, 2) = DateSerial(Year(c) + 10, Month(c), Day(c))
Next
End Sub
 
Top