Find last Sunday

G

Guest

Hi - I'm trying to display data based on the last complete workweek, i.e.
today, the data displayed should be for the week ending Oct. 8. Monday, I
want to display data for the week ending Oct 15. Short of a messy nested 'if'
formula, is there a way to determine the date of the most recent Sunday past?

Thanks
 
N

Niek Otten

=TODAY()-WEEKDAY(TODAY())+1

Format as Date

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi - I'm trying to display data based on the last complete workweek, i.e.
| today, the data displayed should be for the week ending Oct. 8. Monday, I
| want to display data for the week ending Oct 15. Short of a messy nested 'if'
| formula, is there a way to determine the date of the most recent Sunday past?
|
| Thanks
 
D

David Biddulph

For the answer as to why +1 is used, I suggest you look in Excel help for
the WEEKDAY function.

The question, of course, remains as to what the OP would have wanted for
"last Sunday" if today is Sunday. He seemed to be including only the
working week as possible inputs, but if he wants a Sunday date to point back
at the previous Sunday, the formula may need to be expanded a little, such
as
=IF(WEEKDAY(A2)=1,A2-7,A2-WEEKDAY(A2)+1)
or, more obscurely,
=A2-1-MOD(WEEKDAY(A2)+5,7)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top