Thread: Date
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Date

So are you happy that if H1 contains 31-Oct-2008, the resultin G1 is
1-Oct-2008?
I thought you wanted a date in the previous month?
--
David Biddulph

"alf" wrote in message
...

I've only seen now what you purpose [In G1 enter =DATE(YEAR(h1),MONTH
(h1)-1,DAY(h1))]
cool!
thanks!!


On 26 Jan., 09:37, Pecoflyer wrote:
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