View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default formula using dates

=a1-day(a1)
and
=date(year(a1),month(a1),0)

Will both return the last day of the previous month

MelB wrote:

I need a formula that does the following:

If A1 is between(and including) 1/1/08 and 1/31/08 I need 12/31/07 returned.
I need that done for each of the 12 months, ie if A1 is between (and
including) 2/1/08 and 2/28/08 I need 1/31/08 returned.


--

Dave Peterson