Roll up rows into another tab for annual leave calendar.

Fluffy Stockings

New Member
Joined
Dec 28, 2018
Messages
1
Hi all,


I've set up a leave calendar where we add the staff requests row by row. To the right of this there is column for each day of the year. In each of these cells there is a calculation to work out if that day for that person is a true holiday (populates the cell with data from another cell e.g. J6 "Leave PM"/J7 "Leave") or if it's a non-requested day/weekend/bank holiday (leave blank).


This works really well but unfortunately as with any leave request system multiple people can request multiple days on multiple occasions as shown in this spreadsheet. Person 1 has requested 3 holidays (3 rows), Person 2 has requested 2 holidays (2 rows) and Person 3 has requested 1 holiday (1 row).


Is there a way to roll these up on another tab of the spreadsheet which I'll split into months so each person only has 1 row per tab but the row is populated from all rows in the master year tab?


Book1
ABCDEFGHIJKLMN
1Month01/01/2019
2Holidays01/01/201919/04/201922/04/201906/05/201927/05/201926/08/201925/12/201926/12/2019
3Days in Year365
4
5Dates in MonthDayHolidayNameStart DateEnd DateNumber of daysHoliday Type01/01/201902/01/201903/01/201904/01/2019
601/01/2019TueTRUEPerson 101/01/201914/01/201914Leave LeaveLeaveLeave
702/01/2019WedFALSEPerson 202/01/201903/01/20192Leave LeaveLeave 
803/01/2019ThuFALSEPerson 306/01/201906/01/20191Leave PM    
904/01/2019FriFALSEPerson 112/03/201917/03/20196Leave    
1005/01/2019SatTRUEPerson 115/07/201921/07/20197Leave    
1106/01/2019SunTRUEPerson 201/03/201901/03/20191Leave AM    
1207/01/2019MonFALSE    
2019
Cell Formulas
RangeFormula
C6=A6
C7=A7
C8=A8
C9=A9
C10=A10
C11=A11
C12=A12
D6=NOT(NETWORKDAYS.INTL(A6,A6,1,$B$2:$G$2))
D7=NOT(NETWORKDAYS.INTL(A7,A7,1,$B$2:$G$2))
D8=NOT(NETWORKDAYS.INTL(A8,A8,1,$B$2:$G$2))
D9=NOT(NETWORKDAYS.INTL(A9,A9,1,$B$2:$G$2))
D10=NOT(NETWORKDAYS.INTL(A10,A10,1,$B$2:$G$2))
D11=NOT(NETWORKDAYS.INTL(A11,A11,1,$B$2:$G$2))
D12=NOT(NETWORKDAYS.INTL(A12,A12,1,$B$2:$G$2))
K6=IF(AND(NETWORKDAYS.INTL(K$5,K$5,1,$B$2:$I$2),K$5>=$G6,K$5<=$H6),$J6,"")
K7=IF(AND(NETWORKDAYS.INTL(K$5,K$5,1,$B$2:$I$2),K$5>=$G7,K$5<=$H7),$J7,"")
K8=IF(AND(NETWORKDAYS.INTL(K$5,K$5,1,$B$2:$I$2),K$5>=$G8,K$5<=$H8),$J8,"")
K9=IF(AND(NETWORKDAYS.INTL(K$5,K$5,1,$B$2:$I$2),K$5>=$G9,K$5<=$H9),$J9,"")
K10=IF(AND(NETWORKDAYS.INTL(K$5,K$5,1,$B$2:$I$2),K$5>=$G10,K$5<=$H10),$J10,"")
K11=IF(AND(NETWORKDAYS.INTL(K$5,K$5,1,$B$2:$I$2),K$5>=$G11,K$5<=$H11),$J11,"")
K12=IF(AND(NETWORKDAYS.INTL(K$5,K$5,1,$B$2:$I$2),K$5>=$G12,K$5<=$H12),$J12,"")
L6=IF(AND(NETWORKDAYS.INTL(L$5,L$5,1,$B$2:$I$2),L$5>=$G6,L$5<=$H6),$J6,"")
L7=IF(AND(NETWORKDAYS.INTL(L$5,L$5,1,$B$2:$I$2),L$5>=$G7,L$5<=$H7),$J7,"")
L8=IF(AND(NETWORKDAYS.INTL(L$5,L$5,1,$B$2:$I$2),L$5>=$G8,L$5<=$H8),$J8,"")
L9=IF(AND(NETWORKDAYS.INTL(L$5,L$5,1,$B$2:$I$2),L$5>=$G9,L$5<=$H9),$J9,"")
L10=IF(AND(NETWORKDAYS.INTL(L$5,L$5,1,$B$2:$I$2),L$5>=$G10,L$5<=$H10),$J10,"")
L11=IF(AND(NETWORKDAYS.INTL(L$5,L$5,1,$B$2:$I$2),L$5>=$G11,L$5<=$H11),$J11,"")
L12=IF(AND(NETWORKDAYS.INTL(L$5,L$5,1,$B$2:$I$2),L$5>=$G12,L$5<=$H12),$J12,"")
M6=IF(AND(NETWORKDAYS.INTL(M$5,M$5,1,$B$2:$I$2),M$5>=$G6,M$5<=$H6),$J6,"")
M7=IF(AND(NETWORKDAYS.INTL(M$5,M$5,1,$B$2:$I$2),M$5>=$G7,M$5<=$H7),$J7,"")
M8=IF(AND(NETWORKDAYS.INTL(M$5,M$5,1,$B$2:$I$2),M$5>=$G8,M$5<=$H8),$J8,"")
M9=IF(AND(NETWORKDAYS.INTL(M$5,M$5,1,$B$2:$I$2),M$5>=$G9,M$5<=$H9),$J9,"")
M10=IF(AND(NETWORKDAYS.INTL(M$5,M$5,1,$B$2:$I$2),M$5>=$G10,M$5<=$H10),$J10,"")
M11=IF(AND(NETWORKDAYS.INTL(M$5,M$5,1,$B$2:$I$2),M$5>=$G11,M$5<=$H11),$J11,"")
M12=IF(AND(NETWORKDAYS.INTL(M$5,M$5,1,$B$2:$I$2),M$5>=$G12,M$5<=$H12),$J12,"")
N6=IF(AND(NETWORKDAYS.INTL(N$5,N$5,1,$B$2:$I$2),N$5>=$G6,N$5<=$H6),$J6,"")
N7=IF(AND(NETWORKDAYS.INTL(N$5,N$5,1,$B$2:$I$2),N$5>=$G7,N$5<=$H7),$J7,"")
N8=IF(AND(NETWORKDAYS.INTL(N$5,N$5,1,$B$2:$I$2),N$5>=$G8,N$5<=$H8),$J8,"")
N9=IF(AND(NETWORKDAYS.INTL(N$5,N$5,1,$B$2:$I$2),N$5>=$G9,N$5<=$H9),$J9,"")
N10=IF(AND(NETWORKDAYS.INTL(N$5,N$5,1,$B$2:$I$2),N$5>=$G10,N$5<=$H10),$J10,"")
N11=IF(AND(NETWORKDAYS.INTL(N$5,N$5,1,$B$2:$I$2),N$5>=$G11,N$5<=$H11),$J11,"")
N12=IF(AND(NETWORKDAYS.INTL(N$5,N$5,1,$B$2:$I$2),N$5>=$G12,N$5<=$H12),$J12,"")
I6=H6-G6+1
I7=H7-G7+1
I8=H8-G8+1
I9=H9-G9+1
I10=H10-G10+1
I11=H11-G11+1
A6=IF(ROWS(A$6:A6)>$B$3,"",$B$1+ROWS(A$6:A6)-1)
A7=IF(ROWS(A$6:A7)>$B$3,"",$B$1+ROWS(A$6:A7)-1)
A8=IF(ROWS(A$6:A8)>$B$3,"",$B$1+ROWS(A$6:A8)-1)
A9=IF(ROWS(A$6:A9)>$B$3,"",$B$1+ROWS(A$6:A9)-1)
A10=IF(ROWS(A$6:A10)>$B$3,"",$B$1+ROWS(A$6:A10)-1)
A11=IF(ROWS(A$6:A11)>$B$3,"",$B$1+ROWS(A$6:A11)-1)
A12=IF(ROWS(A$6:A12)>$B$3,"",$B$1+ROWS(A$6:A12)-1)
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi Fluffy,

what I would do to roll it up is to ignore the holidays for a first aggregation:
-I made a grid on a sheet with the dates in row 1 and the people in column 1 (both headers)
-so the first formula goes in B2 (your data is on a sheet named SHT): ={IFERROR(INDEX(SHT!$K$6:$K$11,MATCH(1,($A2=SHT!$G$6:$G$11)*(B$1>=SHT!$H$6:$H$11)*(B$1<=SHT!$I$6:$I$11),0)),"")}
-note it's an array formula, so use CTRL+SHIFT+ENTER if you enter the formula
-the base/inspiration of the formula is here: https://exceljet.net/formula/index-and-match-with-multiple-criteria

Hope that helps you moving on.
Cheers,
Koen
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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