• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Given a date, determine a week ending date

In the attached file, I have timesheet dates in column C. Columns G and H define when each work week begins (always on a Monday) and when it ends (always on a Sunday).

For any given date in column C, I want to determine what the week ending date is.

Can I do this w/o using VBA loops?
 

Attachments

  • Chandoo - Determining Week Ending Date.xlsx
    12.1 KB · Views: 8
Narayan as always your solution is great

As per my understanding he is looking for the following week Sunday....if that is the case.....Just adding few lines to your solution....

=(C5+1-WEEKDAY(C5))+7
 
Narayan as always your solution is great

As per my understanding he is looking for the following week Sunday....if that is the case.....Just adding few lines to your solution....

=(C5+1-WEEKDAY(C5))+7

I just realized that this doesn't work if the last day is on a Sunday itself. For example 8/7, 8/8, 8/9 gives 8/10 for the week ending date of Sunday which is correct.

But 8/10 should give 8/10 since it is on a Sunday, but instead it gives 8/17. I can't figure out how to fix this.

Basically, for any given day of the week, round up to the next Sunday. If the day of the week is Sunday, then the result should be that same day.
 
Back
Top