Formula to change date to friday if result is weekend

mecerrato

Board Regular
Joined
Oct 5, 2015
Messages
174
Office Version
  1. 365
Platform
  1. Windows
I have this formula that calculates a date 4 days prior to the entered date in cell H7:
=IF($H$7="","",IFERROR(WORKDAY.INTL($H$7,-4,11,$C$18:$C$37),""))
It sometimes results in a weekend and I want the formula to give me the Friday before if the result falls on a weekend.

I also have another formula that calculates 4 days after the date entered into H11:
=IF($H$11="","",IFERROR(WORKDAY.INTL($H$11,4,11,$C$18:$C$37),""))
It sometimes results in a weekend and I want the formula to give me the Monday after if the result falls on a weekend.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
What do you classify as a weekend?
 
Upvote 0
In that case change the 3rd argument in the workday function from 11 to 1
 
Upvote 0
Solution
Is the problem because you are using the 11 to define the weekend which is only Sunday, for Saturday & Sunday it should be 1
 
Upvote 0
Is the problem because you are using the 11 to define the weekend which is only Sunday, for Saturday & Sunday it should be 1
I can't believe how simplet that was and how I missed that, thanks!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,255
Members
448,556
Latest member
peterhess2002

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