alf;198412 Wrote:
Hi there!
I inserted a date, for example (Nov-08) in the cell H1 of an excel
sheet. I have used the date format and date function.
Now, I'd like the software to automatically fill out the adjacent cell
(s) [G1] with the previous month(s), e.g.: Oct-08.
I got surprised to see that writing "=H1-1" in cell G1 doesn't make it
happen; it just copies "Nov-08".
Can you give me a help?
Thank you in advance for your support!
best,
alf
In G1 enter =DATE(YEAR(h1),MONTH(h1)-1,DAY(h1))
Substracting 1 from a date substracts one day .
For more information on how XL treats dates have a look 'here'
(
http://www.cpearson.com/excel/datetime.htm#AddingDates)
--
Pecoflyer
Cheers -
*'Membership is free' (
http://www.thecodecage.com)* & allows file
upload -faster and better answers
*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile:
http://www.thecodecage.com/forumz/member.php?userid=14
View this thread:
http://www.thecodecage.com/forumz/sh...ad.php?t=54625