Paydays for the start of the year formula

brianfosterblack

Active Member
Joined
Nov 1, 2011
Messages
251
I am trying to get a formula for the first payday of the year depending on a clients requirement. I have this formula to get the first Monday
Excel Formula:
=(DATE(D2,1,1)+CHOOSE(WEEKDAY(DATE(D2,1,1),2),0,6,5,4,3,2,1))
However some of my clients choose their own day of the week to do payslips and I enter the day of the week in cell D63 (It could be any day from Monday through to Friday)
Some I do the payslip every Second week in which case I would have to find that second day in the year. Can anyone help with a formula which actually uses the Weekday entered in D63 and in B63 I enter the frequency (Weekly or BIWeekly)
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Edit the following for your requirements.
You do not have to use named ranges.
The example also includes provision for 2nd instance etc. and holidays; exclude these parts if they are not required.

Workdays.xlsm
ABC
1Year2021
2Date31-Dec-20Exclude Holiday
3
4Next 1st, 2nd, ... from dateDOWResult
51MondayMon 04-Jan-21
61TueTue 05-Jan-21
71WedWed 06-Jan-21
82MonMon 11-Jan-21
91FridayFri 08-Jan-21
10
1d
Cell Formulas
RangeFormula
B2B2=DATE(B1,1,1)-1
C5:C9C5=WORKDAY.INTL($B$2,A5,REPLACE("1111111",MATCH(LEFT(B5,3),DOWS,0),1,0),Holidays)
Named Ranges
NameRefers ToCells
Holidays='1d'!$F$2C5:C9


DOWS is a named information use Name Manager ={"Mon","Tue","Wed","Thu","Fri","Sat","Sun"} or see below
Without the named ranges =WORKDAY.INTL($B$2,A5,REPLACE("1111111",MATCH(LEFT(B5,3),{"Mon","Tue","Wed","Thu","Fri","Sat","Sun"},0),1,0),$F$2)

Include your holiday list if you use that optional parameter.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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