JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
Need assistance please with 2 formula to calculate dates and number of working days in a given week.
C2: 2019 (manually entered)
C8: =IF(WEEKDAY(DATE($C$2,1,1),2)<6,DATE($C$2,1,1),DATE($C$2,1,1)+7-(WEEKDAY(DATE($C$2,1,1)+1)))
(returns the 1st Jan if not a weekend)
C9:C12: =$C8+(7-WEEKDAY($C8,2)+1) (all Mondays in Jan 2019)
C13: 01/02/2019 (1 Feb 2019)
C14:C17: =$C13+(7-WEEKDAY($C13,2)+1) (all Mondays in Feb 2019)
C18: 01/03/2019 (1 Mar 2019)
C19:C22: =$C18+(7-WEEKDAY($C18,2)+1) (all Mondays in Mar 2019)
First formula request is a single formula for C9 to year end, which returns either 1st of a given month if not a weekend and every Monday's date for given year (C2)
D7:H7 contain office locations
Each intersection of a date (C8:C62) vs office location (D7:H7) should show the number of working days in that week, capped by month end and take into account any public holidays for the office location (there is a separate table of locations and public holidays)
E.g. 1 Jan 2019 (C8) for London (D7) would show value 3 in D8 because there are 3 working days including public holidays for UK for week of 1 Jan 2019
21 Jan 2019 (C11) for London (D7) would show 5 in D11
28 Jan 2019 (C12) for London (D7) would show 4 in D12 4 working days that week until end of month for UK
1 Feb 2019 (C13) for London (D7) would show 1 in D13 1 working day that week for new month for UK
4 Feb 2019 (C14) for London (D7) would show 5 in D14 5 working days that week for given month for UK
Second formula request is to calculate the count of workdays for a given date, taking into account any public holidays for that week and location.
TIA for any assistance,
Jack
Need assistance please with 2 formula to calculate dates and number of working days in a given week.
C2: 2019 (manually entered)
C8: =IF(WEEKDAY(DATE($C$2,1,1),2)<6,DATE($C$2,1,1),DATE($C$2,1,1)+7-(WEEKDAY(DATE($C$2,1,1)+1)))
(returns the 1st Jan if not a weekend)
C9:C12: =$C8+(7-WEEKDAY($C8,2)+1) (all Mondays in Jan 2019)
C13: 01/02/2019 (1 Feb 2019)
C14:C17: =$C13+(7-WEEKDAY($C13,2)+1) (all Mondays in Feb 2019)
C18: 01/03/2019 (1 Mar 2019)
C19:C22: =$C18+(7-WEEKDAY($C18,2)+1) (all Mondays in Mar 2019)
First formula request is a single formula for C9 to year end, which returns either 1st of a given month if not a weekend and every Monday's date for given year (C2)
D7:H7 contain office locations
Each intersection of a date (C8:C62) vs office location (D7:H7) should show the number of working days in that week, capped by month end and take into account any public holidays for the office location (there is a separate table of locations and public holidays)
E.g. 1 Jan 2019 (C8) for London (D7) would show value 3 in D8 because there are 3 working days including public holidays for UK for week of 1 Jan 2019
21 Jan 2019 (C11) for London (D7) would show 5 in D11
28 Jan 2019 (C12) for London (D7) would show 4 in D12 4 working days that week until end of month for UK
1 Feb 2019 (C13) for London (D7) would show 1 in D13 1 working day that week for new month for UK
4 Feb 2019 (C14) for London (D7) would show 5 in D14 5 working days that week for given month for UK
Second formula request is to calculate the count of workdays for a given date, taking into account any public holidays for that week and location.
TIA for any assistance,
Jack