Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 year from todays date
I have looked and I know it must be eady but I want to subtract 1 year from
todays date in code, so I tried date-1 year but to no avail, I can use date-365 but I would like it to automatically take into account leap years Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 year from todays date
This formular in code may work
1_yr_before = DateSerial(Year(Now()) - 1, Month(Now()), Day(Now())) yc "Nigel" wrote in message ... I have looked and I know it must be eady but I want to subtract 1 year from todays date in code, so I tried date-1 year but to no avail, I can use date-365 but I would like it to automatically take into account leap years Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 year from todays date
=date(year(date())-1,month(date()),day(date())) will take today's month/day
and the prior year. I'm not sure what you'd get on Feb 29 ;-). "Nigel" wrote: I have looked and I know it must be eady but I want to subtract 1 year from todays date in code, so I tried date-1 year but to no avail, I can use date-365 but I would like it to automatically take into account leap years Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtract 1 year from todays date
using a formula: =EDATE(TODAY(),-12)
using VBA: dateadd("yyyy",-1,date) cheers - voodooJoe "Nigel" wrote in message ... I have looked and I know it must be eady but I want to subtract 1 year from todays date in code, so I tried date-1 year but to no avail, I can use date-365 but I would like it to automatically take into account leap years Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
is there a formula that will subtract todays date from a hire date | Excel Worksheet Functions | |||
How do I subtract todays date from range of dates | Excel Worksheet Functions | |||
Subtract one year from todays date | Excel Discussion (Misc queries) | |||
Subtracting 1 year from todays date | Excel Worksheet Functions | |||
subtract year and divide | Excel Worksheet Functions |