Thread: Date
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
[email protected] groups@biddulph.org.uk is offline
external usenet poster
 
Posts: 1
Default Date

If you have a date in November in H1, and you want G1 to show the last
date in October, the formula to use is
=DATE(YEAR(H1),MONTH(H1),0)
or =DATE(YEAR(H1);MONTH(H1);0) as you are using the semi-colon as list
separator.

--
David Biddulph

On 29 Jan, 14:35, alf wrote:

Hi David,

Thanks for your swift reply!

I'll start to inform you on what you asked:
1.ExcelDatedidn'tshowOct08inG1, in spite of putting Nov-08 as
an excel datein Hi, because I had inserted as a Datefunction the
last day of November [=DATE(2008;11;30)]
2. Have used the formulae istext and isnumber and I have no texts,
just dates

Now I'll reformulate the problem:

Excelis working in a logical way (putting in G1the 29th of November,
in F1 the 28th of November etc.) - I understand it now based on your
explanation, but my objective is to have on cell G1 Oct08, on cell F1
Sep08 etc.
I have tried this by inserting in G1the function =H1-30. This works
for most of the months (Now I can live with this, by correcting the
few wrong ones), but not with all (Probably because of the months with
31 days).
My new question is: is there a way to avoid these manual corrections?

Thanks


On 26 Jan., 09:34, "David Biddulph" <groups [at] biddulph.org.uk
wrote:


If you had actually inserted Nov-08 as an Excel date, =H1-1 would have shown
Oct-08, because Nov-08 as a date defaults to 1-Nov-08 and subtracting 1
would give 31-Oct-08.
My guess is that you've got a text string in H1. *Check with the formulae
=ISTEXT(H1) and ISNUMBER(H1), and by trying to reformat H1 temporarily as a
different date format such as dd/mmm/yyyy; *if the display in H1 doesn't
change, you've got text, not a date.


You confused me a little by referring to the "date format and date
function". *If you used the DATE function, could you show us what formula
you used?
--
David Biddulph


"alf" wrote in message


...


Hi there!


I inserted adate, for example (Nov-08) in the cell H1 of anexcel
sheet. I have used thedateformat anddatefunction.
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 cellG1doesn't make it
happen; it just copies "Nov-08".
Can you give me a help?


Thank you in advance for your support!


best,
alf