Week Calculations - find the Sunday

Cowells01

New Member
Joined
Oct 30, 2020
Messages
6
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. MacOS
I have a date which if it falls between Thursday of week 1 and Wednesday of week 2 I need the date of the Sunday of week 2. But if its pre Wednesday in week 1 then I need the Sunday of week 1. Does that make sense?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try this with your date in A1
Excel Formula:
=WORKDAY.INTL(A1+3,1,"1111110")
 
Upvote 0
Solution
Sure, A1+3 is advancing the original date by 3 days so wednesday becomes saturday, thursday beocmes sunday etc.
"1111110" tells the workday.intl function that sunday is the only working day (the 7 digits represent the week form monday to sunday, with 0 representing working days and 1 representing weekend days).

The function then returns the first working day after the specified date. Wednesday week 1 + 3 days = saturday week 1 so next working day is sunday week 1. Thursday week 1 + 3 days = sunday week 1 so next working day is sunday week 2.

Hope that makes sense.
 
Upvote 0

Forum statistics

Threads
1,215,364
Messages
6,124,510
Members
449,166
Latest member
hokjock

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top