Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with leap year

Status
Not open for further replies.

sedgely

Technical User
Feb 21, 2002
406
GB
OK i know this is probably fairly straight forward, but it is the middle of the afternoon and i'm not functioning well at the mo :)

Anyway i have ane excel sheet where the user enters the first day of the month, i need a variable to hold the same calendar date but for the previous year. at first this seemed fairly straightforward - take the date input by the user and subtract 365. but it falls over with leap years. Anyone any ideas?

Cheers, Craig
Si fractum non sit, noli id reficere
 


Well would it not be the first day of the month the previous year?

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
Have a look at the DateSerial, Day, Month and Year functions.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thx both, told you i was not functioning very well! dateserial fixed it

Cheers, Craig
Si fractum non sit, noli id reficere
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top