View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Next July 1 or January 1

Hi, I was looking for a cell formula to return the next July 1 or
January 1 (whichever falls first) after a given date.

Examples:

3/8/2013 would return 7/1/2013

or

8/21/2014 would return 1/1/2015

Any ideas?

Thanks!


Assuming the date is in colA, and the cell containing this formula is
'Date' format...

=IF(MONTH(A1)<7,DATE(YEAR(A1),7,1),DATE(YEAR(A1)+1 ,1,1))

Perhaps, though, our local formula wizard Claus will have something
better...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion