• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

Can I get a formula for identifying the date of the last day of the week?

I would like to run a formula across a spreadsheet to breakup data into weekly segments for a pivot table. I want to graph that data by the date of the last day for a week.

I want to make a week equal to Monday - Sunday. I can do this with a Weeknum function below.

=WEEKNUM("1/1/14", 2) to get a value of "1"

I need help with a formula where the value would represent the date of the Sunday at the end of the week. So in the example above, the result of "1" would be equal to 1/5/14. I would like to use this formula across a lot of data for an entire year so an ability to fill down is desired.
Brad Rubin
Brad Rubin
1 Solution
Richard ObenchainCommented:
You don't need the week function to do it.

WeekDay([cell],2) will return the Monday-Sunday day of the week (1-7).  So, you do:


... where [cell] is your reference date.  This will look at the current date, figure out how many days it is to the next Sunday, and then add that number of days.

If you want to be absolutely sure you never get a time value added (so that it's just the date part), you can do:


or more simply:

Brad RubinAuthor Commented:
Much appreciated...worked well.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now