If I have understood correctly, here is one way to deal with all that.
1. Introduce a new sheet. I've called mine 'Hols & Weekends'. (As with my previous screen shot, my main sheet is called 'Production' so you may need to alter the formula to reflect your sheet name)
2. Heading for your UK Holidays in A5 & list the holidays below that.
3. Turn A5:A.. into a formal table (Insert -> Table) and via the Name Manager on the Formulas ribbon tab rename the table as UKHols.
4. Copy the formulas in B1:B2 across to column AF, allowing for up to 31 days in a month.
5. Select B2:AF2 and name that range as 'DaysOff'
Notes
Row 1 is really just for visual reference & is not used in my solution.
Row 2 should identify both weekends and any date in the holiday table that falls in the relevant month.
I have hidden most columns just for this screen shot but you can see that March 6 and 30 are normal weekdays but identified as days off because of the UKHols table.
Dates can be added/removed from the UKHols table and the updated info should be reflected in row 2.
Excel Workbook |
---|
|
---|
| A | B | C | D | E | F | G | H | AC | AD | AE | AF |
---|
1 | Date | 1/3/18 | 2/3/18 | 3/3/18 | 4/3/18 | 5/3/18 | 6/3/18 | 7/3/18 | 28/3/18 | 29/3/18 | 30/3/18 | 31/3/18 |
---|
2 | Day Off | FALSE | FALSE | TRUE | TRUE | FALSE | TRUE | FALSE | FALSE | FALSE | TRUE | TRUE |
---|
3 | | | | | | | | | | | | |
---|
4 | | | | | | | | | | | | |
---|
5 | UK Holidays | | | | | | | | | | | |
---|
6 | 1/01/2018 | | | | | | | | | | | |
---|
7 | 12/02/2018 | | | | | | | | | | | |
---|
8 | 6/03/2018 | | | | | | | | | | | |
---|
9 | 30/03/2018 | | | | | | | | | | | |
---|
10 | 15/05/2018 | | | | | | | | | | | |
---|
11 | | | | | | | | | | | | |
---|
|
---|
6. On the main sheet ('Production' for me) ..
- Enter the first date of the month in B1.
- Enter the C1 formula and copy across to AF1.
- Select B1:AF?? and apply the Conditional Formatting shown.
- Note that I have provided some different formulas in columns AG:AJ.
- When you change to a new month, you should simply have to change the date in cell B1 on this sheet.
- Again I have hidden a lot of columns on this sheet for my screen shot.
Post back with any problems of if you need more detailed instructions for any of the steps.
Excel Workbook |
---|
|
---|
| A | B | C | D | E | F | G | H | K | L | V | W | AE | AF | AG | AH | AI | AJ |
---|
1 | | 1/03/18 | 2/03/18 | 3/03/18 | 4/03/18 | 5/03/18 | 6/03/18 | 7/03/18 | 10/03/18 | 11/03/18 | 21/03/18 | 22/03/18 | 30/03/18 | 31/03/18 | Av. (Work days) | Exp. (Work Days) | Av. (7 Days) | Exp. (7 Days) |
---|
2 | Red | 2 | 2 | 0 | 0 | 1 | 2 | 8 | 0 | 0 | 1 | | | | 3.214285714 | 19.28571429 | 2.238095238 | 22.38095238 |
---|
3 | Green | 8 | 9 | 7 | 3 | 1 | 9 | 3 | 3 | 5 | 6 | | | | 5.428571429 | 32.57142857 | 5.666666667 | 56.66666667 |
---|
4 | Blue | 5 | 8 | 8 | 9 | 5 | 5 | 5 | 6 | 2 | 7 | | | | 6.214285714 | 37.28571429 | 6.095238095 | 60.95238095 |
---|
5 | Yellow | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | | | | 0.428571429 | 2.571428571 | 0.285714286 | 2.857142857 |
---|
|
---|
</td></tr></table></td></tr></table> <table style="font-family:Arial; font-size:10pt; background-color:#fffcf9; border-style: groove ;border-color:#ff0000"><tr><td ><b>Conditional formatting </b></td></tr><tr><td ><table border="1" cellspacing="0" cellpadding="0" style="font-family:Arial; font-size:10pt; padding-left:2pt; padding-right:2pt; "><tr><td >Cell</td><td >Nr.: / Condition</td><td >Format</td></tr><tr><td >B1</td><td >1. / Formula is =INDEX(DaysOff,COLUMNS($B1:B1))</td><td style="background-color:#ffff00; ">Abc</td></tr><tr><td >C1</td><td >1. / Formula is =INDEX(DaysOff,COLUMNS($B1:B1))</td><td style="background-color:#ffff00; ">Abc</td></tr></table></td></tr><tr><td ><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#ff0000;background-color:#fffcf9; color:#000000; "><tr><td ><b>Names in Formulas </b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Name</td><td >Applies to</td></tr><tr><td >B1</td><td >DaysOff</td><td >='Hols & Weekends'!$B$2:$AF$2</td></tr><tr><td >C1</td><td >DaysOff</td><td >='Hols & Weekends'!$B$2:$AF$2</td></tr></table></td></tr></table></td></tr></table>