#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default formula using dates

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 145
Default formula using dates

=A1-DAY(A1)

--

Damon Longworth

2007 Excel / Access User Conference

Cambridge, England - Nov 29 - Dec 1, 2007


2008 Excel / Access User Conference

Sydney, Australia - Tentatively March 12-14, 2008
www.ExcelUserConference.com/



"MelB" wrote in message
...
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.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default formula using dates

=DATE(YEAR(A1),MONTH(A1),0)

--
Gary''s Student - gsnu200755
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates formula orquidea Excel Worksheet Functions 5 October 25th 07 02:09 AM
Dates formula davey Excel Worksheet Functions 6 July 21st 07 08:18 PM
Help with Dates in a Formula Jerry Rogers Excel Worksheet Functions 6 June 25th 07 11:21 AM
formula for dates ghynes Excel Worksheet Functions 1 March 27th 07 07:53 PM
how do I use if formula using dates? Simone Excel Worksheet Functions 4 November 8th 05 02:40 AM


All times are GMT +1. The time now is 03:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"