View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Trouble adding or subtracting from the current month

That won't give the correct result in all circumstances, e.g. on 30th and
31st May it'll return "March".

7th January 1900.

If you want to feed TEXT with a date 3 months ago, try
=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())),"mmmm")
[but remember the usual questions, such as what date do you regard as
being
3 months before 31st May?]


I'm not sure why my formula works when David's doesn't (for the dates you
mentioned), but I figured the actual date is immaterial for getting the
month, so I prefilled the year and day in and got this...

=TEXT(DATE(2000,MONTH(A1)-3,1),"mmmm")

which returns February for the dates you mentioned (the date being in A1 for
my example formula). So now the question is.... why does it work when
David's doesn't?

Rick