Help with Weekday Formula

keef2

Board Regular
Joined
Jun 30, 2022
Messages
185
Office Version
  1. 365
Platform
  1. Windows
Hi there,

Looking to have cell M3 = always equal the closest Monday. Right now my formula works for weekend conditions but not if user inputs run data of say 10-4-22. Any help would be appreciated:

SRI Schedule Prototype.xlsx
ABCDEFGHIJKLMNOPQ
1Schedule Run Date:10/3/20221DurationContractSubmittalsLabor Req.Manpower3232323232
2Oct
3Job #Job NameRoof SystemPMSuptStart DateEnd DateContractor34567
Schedule
Cell Formulas
RangeFormula
G1G1=WEEKDAY(C1,2)
M1:Q1M1=IF(SUM(M4:M27)=0,"",SUM(M4:M27))
M2M2=CHOOSE(MONTH(O3),"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
M3M3=IF(WEEKDAY(C1,2)>=6,WORKDAY(C1,1),WORKDAY(C1,0))
N3:Q3N3=WORKDAY(M3,1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M3:ADL27Expression=COUNTIFS(Holidays!$F$3:$F$68,M$3)textNO
I:IExpression=AND(NOT(ISBLANK($A1)),$I1="N")textNO
I:IExpression=AND(NOT(ISBLANK($A1)),$I1="Y")textNO
J:JExpression=AND(NOT(ISBLANK($A1)),$J1="S")textNO
J:JExpression=AND(NOT(ISBLANK($A1)),$J1="NS")textNO
J:JExpression=AND(NOT(ISBLANK($A1)),$J1="A")textNO
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What exactly do you mean by "closest Monday"?
 
Upvote 0
What exactly do you mean by "closest Monday"?
Sorry bad explanation, maybe not closest Monday but previous Monday from the run date listed. So if user inputs today as run date of 10-14-22 the output on M3 should be 10-10-22. Or another example would be if user puts run date of 10-8-22 then it would be 10-3-22. Hopefully this makes more sense?
 
Upvote 0
Ok, how about
Excel Formula:
=WORKDAY.INTL(C1+1,-1,"0111111")
 
Upvote 0
Solution
Ok, how about
Excel Formula:
=WORKDAY.INTL(C1+1,-1,"0111111")
This works as well. Only I dont know how that all works. Both our solutions seem to be working great thanks Fluff!
 
Upvote 0
If the user enters a Sat or Sun date should it still goto the previous Monday or the next Monday?
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,839
Members
449,193
Latest member
MikeVol

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