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
 
Ok.
Glad to help & thanks for the feedback.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,214,788
Messages
6,121,580
Members
449,039
Latest member
Arbind kumar

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