Excel formula needed

FLdave12

Board Regular
Joined
Feb 4, 2022
Messages
62
Platform
  1. Windows
I have excel workbook with 4 sheets in it. It is a bid system workbook where employees bid by seniority for shift, days off and vacation time. The Master Sheet has members broken down by Shift Supervisors, Team Leads and Specialists. I have drop down menus with employee names, Choice of shifts (1st, 2nd, 3rd), and days off (SM, MT,TW, WT, TF, FR, and SS)

I have the other 3 sheets in the workbook labeled 1st, 2nd and 3rd. Each sheet has 6 months with rows for each month, day and date. I want members name and days off to auto fill based on the shift they selected. Also if possible approved vacation dates.
EX.
Month June 1 2 3 4 5 6 7 8 9 10 11 12 13 14
1st Shift S S M T W T F S S M T W T F
Employee 1 X X V V V

I am requesting assistance with formula or formulas to make this work. Appreciate any advice or assistance.



I would like an X to fill in for each employee days off. Ex. An X under day S & S for each of the 6 months.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
What version of Excel are you using? This matters because someone functions are not available in older versions… and the preferred approach may change because of this.

Also, what do you want your result to look like? In the text description, you mention rows containing days and dates, yet in the example, it appears that the dates are running across a single row, so the columns contain information for different dates. Which is it? A more detailed explanation would be useful.
 
Upvote 0
I have Excel 2007. Hope these images help. I would like names to auto fill under 1st shift were the it shows. The X are the days off member gets (FS (Fri/Sat) and then if possible V's under date and day for vacation.
1700614380258.png

Information would be extracted from below Master sheet
1700614689538.png
 
Upvote 0
I have Excel 2007.
Please add that to your Account details (click your user name at the top right of the forum, then 'Account details') so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
I would like names to auto fill...
I'd like to temper your expectations regarding what can be achieved with an older version of Excel. Most of what you've described can be done in Excel 2007 using a formula-based approach, however, you'll see that many of the formulas are long, complex, and full of redundancy. Some of that could be mitigated by introducing additional helper cells to hold certain values that are used repeatedly. For now, I'm offering an approach that uses some helper cells for:
  1. storing the beginning and end of whichever month/year is specified in B1:B2;
  2. storing the beginning and end dates of the two vacation blocks, and
  3. storing the worksheet name, since you plan to use 1st, 2nd, and 3rd, this makes it convenient to use the sheet name to find which members are associated with those shift
Before I describe the month output sheet, let's discuss the Master sheet. I recommend introducing an additional column so that the "Position" and the Member's name can be maintained separately. This makes it easier to determine the number of leaders, supervisors, etc. based on any of various functions that could simply utilize the terms found in the Position column. I also recommend making this Master table an official Excel table (I believe yours may be an official table, but I'm not certain). To convert a range to a table, click anywhere in the range, then Ctrl-t to pop open a small dialog box where you can confirm that the entire range to convert has been identified...and confirm that the table has headers. This conversion facilitates formula-writing and comprehension since structured references can be used (meaning we can refer to the table name and table headings rather than cell ranges). And if the table expands/contracts in size, the formulas relying on those ranges do not require editing. You didn't describe how the vacation block would be recorded...I've assumed it might have the format mm/dd/yyyy-mm/dd/yyyy to denote the start-end dates. As such, that text string needs to be split apart, and rather than do that with a fairly complex formula every time those dates are needed, the formulas appear in helper cells to the right of the month table (in columns AJ:AM) where those results can be referenced by other formulas.

As for "auto fill"...user intervention is necessary with Excel 2007. This would not be the case with Excel 365, where the relevant members who are scheduled for the month would indeed "spill" down the worksheet based on the results of a single formula. But given these limitations of Excel 2007, the sample month sheet below for 1st Shift requires you to specify a year and month in B1:B2. The dates for that month and the day abbreviation are automatically created in rows 5:6. I suggest leaving the size of the "days" part of the table at 31 columns to accommodate any month (and blanks will simply be padded at the end for shorter months). Then the formula in A7 extracts the names of any "Members" who chose the shift matching the sheet name (1st, 2nd, or 3rd). This formula may not work well in Excel 2007...give it a try and let me know. Once entered, it it does not produce output, select the cell where the formula is found, hit F2 to enter "edit" mode, then reconfirm the formula by hitting Ctrl-Shift-Enter simultaneously to enter the formula as an array formula. You may need to then drag the formula to the right one column and down until no more results are produced. This manual intervention is necessary because Excel 2007 does not support "spilling" multiple results...you need to drag the formula until no more results appear. If the formula still gives you trouble, let me know...it may need to be split apart to return only one column at a time. I can't test it because I'm not using Excel 2007.

Then the day "field" of the month table uses a formula to determine...
  1. if that column heading date is not blank (if so, continue evaluating, otherwise a blank),
  2. if the date falls within the vacation block dates (if so, a "V"),
  3. if the day of the week coincides with that member's "weekend" days off (if so, an "X")
  4. and if neither of the two above, then a blank
You will need to drag this formula throughout the relevant month range to get it to populate with results.

You might consider moving the orange "Total" rows to a location above the month table. The rationale for this is that the upper part of your month worksheet would be relatively static, and as the month table grows in length, you won't need to shift the orange Total rows down (maybe this isn't a problem if you have a reasonable upper limit on the length of the month table and set the sheet up to reflect that potential growth). Finally, I'm not certain about which positions get counted as "Supervision" and "Classification Specialists"...I've set up the formulas to allow for multiple types of positions to be counted, but you may need to revise accordingly.
MrExcel_20231122.xlsx
ABCDEF
1PositionMembersShiftDays Off1st Approved Vacation2nd Approved Vacation
2Shift Supervisorsfoxtrot1stMT3/7/2024-3/16/20244/2/2024-4/15/2024
3Shift Supervisorsdelta3rd
4Shift Supervisorslima2nd
5Shift Supervisorsmike1stWT3/11/2024-3/16/2024
6Team Leaderscharlie2nd
7Team Leadersjuliett1stSS3/20/20244/7/2024
8Team Leaders
9Job Assignmentalpha2nd
10Job Assignmentkilo2nd
11Job Assignmentbravo1stTW
12Reclassificationindia2nd
13Reclassificationecho1stTF3/3/2024-3/6/20243/27/2024-3/30/2024
14Reclassification
15Specialistsgolf3rd
16Specialistshotel1stFS
17
Master


These formulas are dragged out to column AG so that there are 31 columns to accommodate any month:
MrExcel_20231122.xlsx
ABCDEFGHIJKL
1Year2024
2MonthMarch
3
4
51st ShiftMembers12345678910
6FSSMTWTFSS
7Shift Supervisorsfoxtrot   XX VVVV
8Shift Supervisorsmike     XX   
9Team Leadersjuliett XX     XX
10Job Assignmentbravo    XX    
11ReclassificationechoX VVVVXX  
12SpecialistshotelXX     XX 
13
14
15Total Supervision Working Leaders3333333333
16Total Classification Specialists1111111111
17Total on Shift4444444444
1st
Cell Formulas
RangeFormula
A5A5=AJ3 & " Shift"
C5:L5C5=IF(COLUMNS($C:C)>$AJ$2-$AJ$1+1,"",$AJ$1+COLUMNS($C:C)-1)
C6:L6C6=IF(COLUMNS($C:C)>$AJ$2-$AJ$1+1,"",CHOOSE(WEEKDAY($AJ$1+COLUMNS($C:C)-1),"S","M","T","W","T","F","S"))
C7:L12C7= IF(AND(ISNUMBER(C$5),$B7<>""), IF(OR(AND(C$5>=$AJ7,C$5<=$AK7),AND(C$5>=$AL7,C$5<=$AM7)),"V", IF( OR( MOD(MATCH(INDEX(tblMaster[Days Off],MATCH($B7,tblMaster[Members],0)),{"SM","MT","TW","WT","TF","FS","SS"},0)-1,7)+1=WEEKDAY(C$5), MOD(MATCH(INDEX(tblMaster[Days Off],MATCH($B7,tblMaster[Members],0)),{"SM","MT","TW","WT","TF","FS","SS"},0),7)+1=WEEKDAY(C$5) ), "X", "")),"")
A7:B12A7=IFERROR(INDEX(tblMaster[[Position]:[Members]],AGGREGATE(15,6,(ROW(tblMaster[Shift])-ROW(tblMaster[[#Headers],[Shift]]))/(tblMaster[Shift]=$AJ$3),ROWS($7:7)),{1,2}),"")
C15:L15C15=IF(C$5="","",SUMPRODUCT(((($A$7:$A$11="Shift Supervisors")+($A$7:$A$11="Team Leaders"))>0)*($C$7:$C$11="")))
C16:L16C16=IF(C$5="","",SUMPRODUCT(((($A$7:$A$11="Specialists")+($A$7:$A$11="Job Assignment"))>0)*($C$7:$C$11="")))
C17:L17C17=IF(C$5="","",SUM(C15:C16))
Dynamic array formulas.


And the helper cells to the right of the month table (be sure to select all four vacation start/end formulas and drag the formulas down so that they can "operate" on any members added to the month table):
MrExcel_20231122.xlsx
AJAKALAM
103/01/24Mo Begin
203/31/24Mo End
31stSheet
4
5
6V1-StartV1-EndV2-StartV2-End
745358453674538445397
84536245367  
945371453714538945389
10    
1145354453574537845381
12    
13
1st
Cell Formulas
RangeFormula
AJ1AJ1=(B2&" 1"&", "&B1)+0
AJ2AJ2=EOMONTH(AJ1,0)
AJ3AJ3=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
AJ7:AJ12AJ7=IF($B7<>"", IF(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( LEFT(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)), SEARCH("-",INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)))-1 ) +0, INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
AK7:AK12AK7=IF($B7<>"", IF(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( RIGHT(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)), LEN(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))) - SEARCH("-",INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))) ) +0, INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
AL7:AL12AL7=IF($B7<>"", IF(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( LEFT(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)), SEARCH("-",INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)))-1 ) +0, INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
AM7:AM12AM7=IF($B7<>"", IF(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( RIGHT(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)), LEN(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))) - SEARCH("-",INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))) ) +0, INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
 
Upvote 0
I'd like to temper your expectations regarding what can be achieved with an older version of Excel. Most of what you've described can be done in Excel 2007 using a formula-based approach, however, you'll see that many of the formulas are long, complex, and full of redundancy. Some of that could be mitigated by introducing additional helper cells to hold certain values that are used repeatedly. For now, I'm offering an approach that uses some helper cells for:
  1. storing the beginning and end of whichever month/year is specified in B1:B2;
  2. storing the beginning and end dates of the two vacation blocks, and
  3. storing the worksheet name, since you plan to use 1st, 2nd, and 3rd, this makes it convenient to use the sheet name to find which members are associated with those shift
Before I describe the month output sheet, let's discuss the Master sheet. I recommend introducing an additional column so that the "Position" and the Member's name can be maintained separately. This makes it easier to determine the number of leaders, supervisors, etc. based on any of various functions that could simply utilize the terms found in the Position column. I also recommend making this Master table an official Excel table (I believe yours may be an official table, but I'm not certain). To convert a range to a table, click anywhere in the range, then Ctrl-t to pop open a small dialog box where you can confirm that the entire range to convert has been identified...and confirm that the table has headers. This conversion facilitates formula-writing and comprehension since structured references can be used (meaning we can refer to the table name and table headings rather than cell ranges). And if the table expands/contracts in size, the formulas relying on those ranges do not require editing. You didn't describe how the vacation block would be recorded...I've assumed it might have the format mm/dd/yyyy-mm/dd/yyyy to denote the start-end dates. As such, that text string needs to be split apart, and rather than do that with a fairly complex formula every time those dates are needed, the formulas appear in helper cells to the right of the month table (in columns AJ:AM) where those results can be referenced by other formulas.

As for "auto fill"...user intervention is necessary with Excel 2007. This would not be the case with Excel 365, where the relevant members who are scheduled for the month would indeed "spill" down the worksheet based on the results of a single formula. But given these limitations of Excel 2007, the sample month sheet below for 1st Shift requires you to specify a year and month in B1:B2. The dates for that month and the day abbreviation are automatically created in rows 5:6. I suggest leaving the size of the "days" part of the table at 31 columns to accommodate any month (and blanks will simply be padded at the end for shorter months). Then the formula in A7 extracts the names of any "Members" who chose the shift matching the sheet name (1st, 2nd, or 3rd). This formula may not work well in Excel 2007...give it a try and let me know. Once entered, it it does not produce output, select the cell where the formula is found, hit F2 to enter "edit" mode, then reconfirm the formula by hitting Ctrl-Shift-Enter simultaneously to enter the formula as an array formula. You may need to then drag the formula to the right one column and down until no more results are produced. This manual intervention is necessary because Excel 2007 does not support "spilling" multiple results...you need to drag the formula until no more results appear. If the formula still gives you trouble, let me know...it may need to be split apart to return only one column at a time. I can't test it because I'm not using Excel 2007.

Then the day "field" of the month table uses a formula to determine...
  1. if that column heading date is not blank (if so, continue evaluating, otherwise a blank),
  2. if the date falls within the vacation block dates (if so, a "V"),
  3. if the day of the week coincides with that member's "weekend" days off (if so, an "X")
  4. and if neither of the two above, then a blank
You will need to drag this formula throughout the relevant month range to get it to populate with results.

You might consider moving the orange "Total" rows to a location above the month table. The rationale for this is that the upper part of your month worksheet would be relatively static, and as the month table grows in length, you won't need to shift the orange Total rows down (maybe this isn't a problem if you have a reasonable upper limit on the length of the month table and set the sheet up to reflect that potential growth). Finally, I'm not certain about which positions get counted as "Supervision" and "Classification Specialists"...I've set up the formulas to allow for multiple types of positions to be counted, but you may need to revise accordingly.
MrExcel_20231122.xlsx
ABCDEF
1PositionMembersShiftDays Off1st Approved Vacation2nd Approved Vacation
2Shift Supervisorsfoxtrot1stMT3/7/2024-3/16/20244/2/2024-4/15/2024
3Shift Supervisorsdelta3rd
4Shift Supervisorslima2nd
5Shift Supervisorsmike1stWT3/11/2024-3/16/2024
6Team Leaderscharlie2nd
7Team Leadersjuliett1stSS3/20/20244/7/2024
8Team Leaders
9Job Assignmentalpha2nd
10Job Assignmentkilo2nd
11Job Assignmentbravo1stTW
12Reclassificationindia2nd
13Reclassificationecho1stTF3/3/2024-3/6/20243/27/2024-3/30/2024
14Reclassification
15Specialistsgolf3rd
16Specialistshotel1stFS
17
Master


These formulas are dragged out to column AG so that there are 31 columns to accommodate any month:
MrExcel_20231122.xlsx
ABCDEFGHIJKL
1Year2024
2MonthMarch
3
4
51st ShiftMembers12345678910
6FSSMTWTFSS
7Shift Supervisorsfoxtrot   XX VVVV
8Shift Supervisorsmike     XX   
9Team Leadersjuliett XX     XX
10Job Assignmentbravo    XX    
11ReclassificationechoX VVVVXX  
12SpecialistshotelXX     XX 
13
14
15Total Supervision Working Leaders3333333333
16Total Classification Specialists1111111111
17Total on Shift4444444444
1st
Cell Formulas
RangeFormula
A5A5=AJ3 & " Shift"
C5:L5C5=IF(COLUMNS($C:C)>$AJ$2-$AJ$1+1,"",$AJ$1+COLUMNS($C:C)-1)
C6:L6C6=IF(COLUMNS($C:C)>$AJ$2-$AJ$1+1,"",CHOOSE(WEEKDAY($AJ$1+COLUMNS($C:C)-1),"S","M","T","W","T","F","S"))
C7:L12C7= IF(AND(ISNUMBER(C$5),$B7<>""), IF(OR(AND(C$5>=$AJ7,C$5<=$AK7),AND(C$5>=$AL7,C$5<=$AM7)),"V", IF( OR( MOD(MATCH(INDEX(tblMaster[Days Off],MATCH($B7,tblMaster[Members],0)),{"SM","MT","TW","WT","TF","FS","SS"},0)-1,7)+1=WEEKDAY(C$5), MOD(MATCH(INDEX(tblMaster[Days Off],MATCH($B7,tblMaster[Members],0)),{"SM","MT","TW","WT","TF","FS","SS"},0),7)+1=WEEKDAY(C$5) ), "X", "")),"")
A7:B12A7=IFERROR(INDEX(tblMaster[[Position]:[Members]],AGGREGATE(15,6,(ROW(tblMaster[Shift])-ROW(tblMaster[[#Headers],[Shift]]))/(tblMaster[Shift]=$AJ$3),ROWS($7:7)),{1,2}),"")
C15:L15C15=IF(C$5="","",SUMPRODUCT(((($A$7:$A$11="Shift Supervisors")+($A$7:$A$11="Team Leaders"))>0)*($C$7:$C$11="")))
C16:L16C16=IF(C$5="","",SUMPRODUCT(((($A$7:$A$11="Specialists")+($A$7:$A$11="Job Assignment"))>0)*($C$7:$C$11="")))
C17:L17C17=IF(C$5="","",SUM(C15:C16))
Dynamic array formulas.


And the helper cells to the right of the month table (be sure to select all four vacation start/end formulas and drag the formulas down so that they can "operate" on any members added to the month table):
MrExcel_20231122.xlsx
AJAKALAM
103/01/24Mo Begin
203/31/24Mo End
31stSheet
4
5
6V1-StartV1-EndV2-StartV2-End
745358453674538445397
84536245367  
945371453714538945389
10    
1145354453574537845381
12    
13
1st
Cell Formulas
RangeFormula
AJ1AJ1=(B2&" 1"&", "&B1)+0
AJ2AJ2=EOMONTH(AJ1,0)
AJ3AJ3=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
AJ7:AJ12AJ7=IF($B7<>"", IF(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( LEFT(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)), SEARCH("-",INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)))-1 ) +0, INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
AK7:AK12AK7=IF($B7<>"", IF(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( RIGHT(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)), LEN(INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))) - SEARCH("-",INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0))) ) +0, INDEX(tblMaster[1st Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
AL7:AL12AL7=IF($B7<>"", IF(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( LEFT(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)), SEARCH("-",INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)))-1 ) +0, INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
AM7:AM12AM7=IF($B7<>"", IF(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))<>"", IFERROR( RIGHT(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)), LEN(INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))) - SEARCH("-",INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0))) ) +0, INDEX(tblMaster[2nd Approved Vacation],MATCH($B7,tblMaster[Members],0)) ),""),"")
I apologize I did not realize I did not mention I have access to Excel 365 at work. Is it possible to convert excel sheet from 2007 to 365? Also, would it be easier to format what I am wanting instead of the long formulas.
 
Upvote 0
A quick note about my last offering. It still won't work as written with Excel 2007. Peter (@Peter_SSs) had reminded me a few months ago about using AGGREGATE...here:
The AGGREGATE function did not become available until Excel 2010. In any case, a different approach is needed to pull members from the Master sheet into the monthly "shift" sheets using Excel 2007. That's still doable, but requires a rework of the formula that uses AGGREGATE.

It isn't possible to convert a sheet directly from 2007 to 365, but the formulas can be rewritten using more convenient functions. I'll do that when I have some spare time and post back. Excel 365 would be very much preferred in this case.
 
Upvote 0
I am working on putting information into Excel 365 and will upload as soon as I get it completed. I appreciate all of your help and hope
me putting into 365 will make it easier for your assistance.

Thanks again
 
Upvote 0
I am attaching screen shots of Master, 1st, 2nd, and 3rd sheets using Excel 365. The XL2BB download did not work to send entire workbook.

Also, is it possible to have formula to auto-fill the month and year for the 6 months of each 1st, 2nd and 3rd sheets?

Again thank you for all your help
 

Attachments

  • Master Sheet Bid.jpg
    Master Sheet Bid.jpg
    138.3 KB · Views: 12
  • 1st shift.jpg
    1st shift.jpg
    242.2 KB · Views: 13
  • 2nd Shift.jpg
    2nd Shift.jpg
    186 KB · Views: 13
  • 3rd Shift.png
    3rd Shift.png
    18.1 KB · Views: 9
Upvote 0
Here is a version that relies on Excel 365 and some of the more advance functions to spill the results from single formulas. These functions also allow you to avoid helper cells by assigning those values (associated with helper cells previously described) to variables within the formulas.

The sample sheet below contains only five formulas, although some of those formulas perform multiple steps. Once the sheet is set up, the formulas create the monthly table, pull in relevant data from Master, depending on the sheet name (which must be either 1st, 2nd, or 3rd). The user input for year and month are used to establish the appropriate width of the monthly table. C5# (meaning cell C5 and the additional array elements that spill from it) are formatted as dates, and the display format is "d" to show only the day-of-the-month number. C6# operates on the C5# date array to determine the "weekday" number and converts that into a single letter to be consistent with your original suggested output format (so returned values are S,M,T,W,T,F,S).

A7# creates the following assignments:
  • sht is the sheet name (used for determining which members are scheduled for the relevant shift
  • ary is the Master table, filtered to show only the rows associated with the relevant shift
  • pm is the the 2-column array taken from ary to show the Position and Member name
  • v1st is the 1-column array taken from ary that shows the 1st Vacation Approved data
  • v2nd is the 1-column array taken from ary that shows the 2nd Vacation Approved data
  • v1b, v1e, v2b, and v2e and the dates extracted from v1st and v2nd that describe the beginning and end dates for the two vacation blocks
  • doi is the index for the "Days Off" (extracted as a 1-column array from ary) that correspond to the array shown in the formula...this serves as a code number (used later) to denote the first day of the contiguous two-day "weekend"
  • vdo is the Vacation and Days Off part of the formula. This formula examines the entire C5# date range to determine which dates, if any, fall within vacation blocks (if so, a "V" is returned). Then the doi (days off index code mentioned above) is used to determine which dates in C5# correspond to that member's "weekend" (whereupon an "X" is returned).
  • Finally, the pm and vdo arrays are stacked horizontally (HSTACK) to return the entire results table, which spills from A7#.
I'm not sure about the "Totals" section you've shown. I've made an attempt to interpret what you want, but it may not be correct. In C15# is a single formula that creates three horizontal arrays. The first array determines if a Shift Supervisor or a Team Lead appears in the results table, and then based on a column-by-column evaluation, whether those individuals have blanks for that day (meaning they are scheduled...and are not "out" for the "weekend" or vacation)...and a sum is taken of the number of members meeting these criteria. The same evaluation is made for the second array, except the position type used is "Classification Specialist" only. The third array examines each column of the results output and takes the sum of all members who have a blank, regardless of their position. Please confirm these details are correct, and let me know what needs attention. And finally, all three of these arrays are combined in a vertical stack to spill them with a single formula.

Also, is it possible to have formula to auto-fill the month and year for the 6 months of each 1st, 2nd and 3rd sheets?
I'm not sure what you mean by this. If you select a different year/month in B1:B2, the output table will adjust to the correct number of days and any members on the Master sheet associated with a Shift corresponding to the Sheet name will be automatically pulled into the monthly results table, and any "weekend" days for each member will be marked with "X" (or "V" if they're on vacation...maybe the order of the V and X should be changed so that X appears preferentially over V if someone is on vacation that spans their "weekend"?), and any vacation days will be marked with "V". If you make a copy of this worksheet and change the sheet name to a different shift designation (like 1st or 2nd), then the results table should also update.
MrExcel_20231122.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1Year2024
2MonthMarch
3
4
53rd ShiftMembers12345678910111213141516171819202122232425262728293031
6FSSMTWTFSSMTWTFSSMTWTFSSMTWTFSS
7Shift SupervisordeltaXVVVVVVVVVVXXXXXX
8Classification SpecialistgolfXXXXXXXX
9Classification SpecialistoscarXXXXXXXX
10
11
12
13
14
15Total Supervision Working Leaders0000000000011001111100111110011
16Total Classification Specialists2221012222101222210122221012222
17Total on Shift2221012222112223321222332122233
3rd
Cell Formulas
RangeFormula
A5A5=TEXTAFTER(CELL("filename",A1),"]") & " Shift"
C5:AG5C5=LET(mobegin,DATE(B1,MONTH(B2&1),1),SEQUENCE(1,DAY(EOMONTH(mobegin,0)),mobegin))
C6:AG6C6=CHOOSE(WEEKDAY(C5#),"S","M","T","W","T","F","S")
A7:AG9A7=LET(sht,TEXTAFTER(CELL("filename",A1),"]"),ary,FILTER(tblMaster,tblMaster[Shift]=sht,""), pm,CHOOSECOLS(ary,1,2), v1st,CHOOSECOLS(ary,5),v2nd,CHOOSECOLS(ary,6), v1b,IFERROR(TEXTBEFORE(v1st,"-")+0,""),v1e,IFERROR(TEXTAFTER(v1st,"-")+0,""),v2b,IFERROR(TEXTBEFORE(v2nd,"-")+0,""),v2e,IFERROR(TEXTAFTER(v2nd,"-")+0,""), doi,MATCH(CHOOSECOLS(ary,4),{"SM","MT","TW","WT","TF","FS","SS"},0), vdo,IF(((C5#>=v1b)*(C5#<=v1e)+(C5#>=v2b)*(C5#<=v2e)>0),"V", IF(((MOD(doi-1,7)+1=WEEKDAY(C5#))+(MOD(doi,7)+1=WEEKDAY(C5#))>0),"X","")), HSTACK(pm,vdo))
C15:AG17C15=LET(stl,BYCOL(DROP(A7#,,2),LAMBDA(c,LET(p,CHOOSECOLS(A7#,1),SUM(((p="Shift Supervisor")+(p="Team Lead")>0)*(c=""))))), sp,BYCOL(DROP(A7#,,2),LAMBDA(c,LET(p,CHOOSECOLS(A7#,1),SUM((p="Classification Specialist")*(c=""))))), tot,BYCOL(DROP(A7#,,2),LAMBDA(c,LET(p,CHOOSECOLS(A7#,1),SUM(--(c=""))))), VSTACK(stl,sp,tot))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B2ListJanuary,February,March,April,May,June,July,August,September,October,November,December

Above uses this Master sheet:
MrExcel_20231122.xlsx
ABCDEF
1PositionMemberShiftDays Off1st Approved Vacation2nd Approved Vacation
2Shift Supervisorfoxtrot1stMT3/7/2024-3/16/20244/2/2024-4/15/2024
3Shift Supervisordelta3rdTF3/2/2024-3/11/2024
4Shift Supervisorlima2ndWT
5Shift Supervisormike1stWT3/11/2024-3/16/2024
6Team Leadcharlie2ndFS
7Team Leadjuliet1stSS3/20/20244/7/2024
8Team Lead
9Job Assignment Specialistalpha2ndSS3/2/2024-3/11/2024
10Job Assignment Specialistkilo2ndMT
11Job Assignment Specialistbravo1stTW
12Reclassification Specialistindia2ndTF
13Reclassification Specialistecho1stTF3/3/2024-3/6/20243/27/2024-3/30/2024
14Reclassification Specialist
15Classification Specialistgolf3rdTW
16Classification Specialisthotel1stFS
17Classification Specialistoscar3rdMT
18Classification Specialistnovember2ndWT
Master
Cells with Data Validation
CellAllowCriteria
C2:C18List1st,2nd,3rd
D2:D18ListSM,MT,TW,WT,TF,FS,SS
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,956
Members
449,096
Latest member
Anshu121

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