Finding the next dayof the week after a certain date.
On Thu, 21 Aug 2008 09:13:01 -0700, Kevin Mulvaney
wrote:
Is there a way to return the date of a particular day after a date, i.e. my
work month always starts on the 26th, but the week ends on sunday. I would
like to enter the first day of the month (the 26th), and automaticaly
generate the week start and end dates (mon-sun). I need a formula to return
the date for the first sunday after the 26th.
ex: week 1 - 6/26/08(thu) - 6/29/08(sun)
week 2 - 6/30/08(mon) - 7/6/08(sun)
I'm not sure of all your rules, but
=A1+7-WEEKDAY(A1+6)
will return the first Sunday on or after the date in A1
(If A1 is a Sunday, it will return the same date)
=A1+14-WEEKDAY(A1+6)
will return the first Sunday after the date in A1
(If A1 is a Sunday, it will return the following Sunday).
--ron
|