Index Match Formula to generate a report duplicates? Rosters/Vacancies

Jay88

New Member
Joined
Apr 17, 2023
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
G'day from Australia!

Long time lurker, first time poster!


Getting a bit stumped figuring a formula to generate a report using INDEX MATCH to detail all "VACANT" positions.

This roster is an example (which generally varies in rows and titles) the only "fixed points" I can constantly refer to are;
  • Area=A:A
  • Section=B:B
  • Shift Timings=C:C
  • Role=E:E
  • Shift Length (2 cells underneath VACANT/Employee Name)
  • Alongside the day columns (i.e Mon= F:F, Tue=G:G, Wed=H:H) for Weeks 1 & 2

Please see the example below for an illustration (populated rosters generally expand over 300 rows)

Book1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXY
1
2AM Clinical ManagementAM Clinical Management
3AreaSectionShiftWK HrsRoleMonTueWedThuFriSatSunAreaSectionShiftWK HrsRoleMonTueWedThuFriSatSun
4Clinical Mngmt09:00 - 17:06CMEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameClinical Mngmt09:00 - 17:06CMVACANTVACANTEmployee NameEmployee NameEmployee Name
5
67.6387.67.67.67.67.67.6387.67.67.67.67.6
7Clinical Mngmt07:00 - 15:00RNEmployee NameEmployee NameClinical Mngmt07:00 - 15:00RNEmployee NameEmployee Name
8
97.5157.57.57.5157.57.5
10Clinical Mngmt07:00 - 15:00RNEmployee NameVACANTEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameClinical Mngmt07:00 - 15:00RNEmployee NameVACANTEmployee NameEmployee NameEmployee NameEmployee NameEmployee Name
11
127.552.57.57.57.57.57.57.57.57.552.57.57.57.57.57.57.57.5
13Clinical Mngmt14:45 - 22:15RNEmployee NameEmployee NameEmployee NameVACANTVACANTVACANTEmployee NameClinical Mngmt14:45 - 22:15RNEmployee NameEmployee NameEmployee NameVACANTVACANTVACANTEmployee Name
14
157.552.57.57.57.57.57.57.57.57.552.57.57.57.57.57.57.57.5
16Clinical Mngmt22:00 - 07:15RNEmployee NameEmployee NameVACANTVACANTEmployee NameEmployee NameEmployee NameClinical Mngmt22:00 - 07:15RNEmployee NameEmployee NameVACANTVACANTEmployee NameEmployee NameEmployee Name
17
189.2564.759.259.259.259.259.259.259.259.2564.759.259.259.259.259.259.259.25
19
20AMNorth A & B (65 Beds)AMNorth A & B (65 Beds)
21AreaSectionShiftWK HrsRoleMonTueWedThuFriSatSunAreaSectionShiftWK HrsRoleMonTueWedThuFriSatSun
22North Wing07:00 - 15:00RNVACANTEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameVACANTNorth Wing07:00 - 15:00RNVACANTEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameVACANT
23
247.552.57.57.57.57.57.57.57.57.552.57.57.57.57.57.57.57.5
25North Wing07:00 - 14:30EENEmployee NameEmployee NameEmployee NameEmployee NameVACANTVACANTEmployee NameNorth Wing07:00 - 14:30EENEmployee NameEmployee NameEmployee NameEmployee NameVACANTVACANTEmployee Name
26
2774977777777497777777
28
29PMNorth A & B (65 Beds)PMNorth A & B (65 Beds)
30AreaSectionShiftWK HrsRoleMonTueWedThuFriSatSunAreaSectionShiftWK HrsRoleMonTueWedThuFriSatSun
31North Wing14:45 - 22:00RNEmployee NameEmployee NameVACANTVACANTVACANTEmployee NameEmployee NameNorth Wing14:45 - 22:00RNEmployee NameEmployee NameVACANTVACANTVACANTEmployee NameEmployee Name
32
336.7547.256.756.756.756.756.756.756.756.7547.256.756.756.756.756.756.756.75
34North Wing15:00 - 21:00RNEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameNorth Wing15:00 - 21:00RNEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee Name
35
365.538.55.55.55.55.55.55.55.55.538.55.55.55.55.55.55.55.5
37
38AMNorth A & B (65 Beds)AMNorth A & B (65 Beds)
39AreaSectionShiftWK HrsRoleMonTueWedThuFriSatSunAreaSectionShiftWK HrsRoleMonTueWedThuFriSatSun
40North WingA07:00 - 14:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameNorth WingA07:00 - 14:00PCAVACANTVACANTVACANTVACANTVACANTVACANTVACANT
41
426.545.56.56.56.56.56.56.56.56.545.56.56.56.56.56.56.56.5
43North WingA07:00 - 14:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameNorth WingA07:00 - 14:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee Name
44
456.545.56.56.56.56.56.56.56.56.545.56.56.56.56.56.56.56.5
46North WingB07:00 - 14:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameNorth WingB07:00 - 14:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee Name
47
486.545.56.56.56.56.56.56.56.56.545.56.56.56.56.56.56.56.5
49North WingB07:00 - 14:00PCAEmployee NameEmployee NameVACANTVACANTEmployee NameEmployee NameEmployee NameNorth WingB07:00 - 14:00PCAEmployee NameEmployee NameVACANTVACANTEmployee NameEmployee NameEmployee Name
50
516.545.56.56.56.56.56.56.56.56.545.56.56.56.56.56.56.56.5
52North WingA07:00 - 15:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameNorth WingA07:00 - 15:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee Name
53
547.552.57.57.57.57.57.57.57.57.552.57.57.57.57.57.57.57.5
55North WingA07:00 - 15:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameVACANTVACANTNorth WingA07:00 - 15:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameVACANTVACANT
56
577.552.57.57.57.57.57.57.57.57.552.57.57.57.57.57.57.57.5
58North WingB07:00 - 15:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameNorth WingB07:00 - 15:00PCAEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee NameEmployee Name
59
607.552.57.57.57.57.57.57.57.57.552.57.57.57.57.57.57.57.5
61North WingB07:00 - 15:00PCAEmployee NameEmployee NameVACANTEmployee NameVACANTEmployee NameEmployee NameNorth WingB07:00 - 15:00PCAEmployee NameEmployee NameVACANTEmployee NameVACANTEmployee NameEmployee Name
62
637.552.57.57.57.57.57.57.57.57.552.57.57.57.57.57.57.57.5
64Total AM Hours392Total AM Hours392
Roster
Cell Formulas
RangeFormula
D6,Q6D6=SUM(F6:J6)
F6:J6,S60:Y60,F60:L60,S57:Y57,F57:L57,S54:Y54,F54:L54,S51:Y51,F51:L51,S48:Y48,F48:L48,S45:Y45,F45:L45,S42:Y42,F42:L42,S36:Y36,F36:L36,S33:Y33,F33:L33,S27:Y27,F27:L27,S24:Y24,F24:L24,S18:Y18,F18:L18,S15:Y15,F15:L15,S12:Y12,F12:L12,S6:W6F6=$C6
D9,Q9D9=SUM(K9:L9)
K9:L9,X9:Y9K9=$C$9
D12,Q63,D63,Q60,D60,Q57,D57,Q54,D54,Q51,D51,Q48,D48,Q45,D45,Q42,D42,Q36,D36,Q33,D33,Q27,D27,Q24,D24,Q18,D18,Q15,D15,Q12D12=SUM(F12:L12)
F63:L63,S63:Y63F63=$C$63
D64,Q64D64=SUM(D42:D63)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
S:YCell Value="VACANT"textNO
F1:L132,F134:L147,I133:L133,F149:L1048576,G148:L148Cell Value="VACANT"textNO


Ideally, I am seeking a way to generate an easy-to-read report of vacancies, perhaps, something like below? PS. by all means this particular format is not obligatory, just a quick mockup, should you have a more clearer or elegant solution, I would be grateful to hear your thoughts.

Book1.xlsx
ABCDEFGHIJKLMNOPQR
1Vacancy Report
2Week 1Week 2
3AreaSectionHoursRoleMonTueWedThuFriSatSunMonTueWedThuFriSatSun
4Clinical Mngmt15.2CM09:00 - 17:0609:00 - 17:07
5Clinical Mngmt15RN07:00 - 15:0007:00 - 15:00
6Clinical Mngmt45RN14:45 - 22:1514:45 - 22:1514:45 - 22:1514:45 - 22:1514:45 - 22:1514:45 - 22:15
7North WingA
8North WingA
9North WingB
10North WingB
11North WingA
12North WingA
13South WingB
14South WingB
15South WingB
16South WingA
17South WingA
18South WingA
19Therapy
20Therapy
21
Report
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E4:R20Cellcontains a blank value textNO
L3:R3Cell Value="VACANT"textNO
E3:K3Cell Value="VACANT"textNO



Thanks in advance,

Jason
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi happy to see your first post!
I have a few observations and questions though.
It is really really tough to flush out one kind of report from another. Your first report has merged cells and is much like a complex cross tab report.
Do you have a list of data that can make everyone's task regarding your reporting much easier, something with columns like this:
Area=A:A
Section=B:B
Shift Timings=C:C
Role=E:E
Shift Start Date:
Shift Start Time:
Shift End Date:
Shift End time:
(note: the start and end dates/times can also be combined into a Date/Time Value)
Vacant/Present

if you have data like this you can easily make any kind of report on staffing.
 
Upvote 1
try this and let me know if this work for what you're looking for
-------------------------
Rosters-Vacancies.xlsx
ABCDEFGHIJKLMNOPQRS
1Vacancy Report
2Week 1Week 2
3AreaSectionHoursRoleMonTueWedThuFriSatSunMonTueWedThuFriSatSun
4Clinical Mngmt09:00 - 17:06CM       09:00 - 17:0609:00 - 17:06     
5Clinical Mngmt07:00 - 15:00RN 07:00 - 15:00      07:00 - 15:00     
6Clinical Mngmt07:00 - 15:00RN 07:00 - 15:00      07:00 - 15:00     
7Clinical Mngmt14:45 - 22:15RN   14:45 - 22:1514:45 - 22:1514:45 - 22:15    14:45 - 22:1514:45 - 22:1514:45 - 22:15 
8Clinical Mngmt22:00 - 07:15RN  22:00 - 07:1522:00 - 07:15     22:00 - 07:1522:00 - 07:15   
9North Wing07:00 - 15:00RN07:00 - 15:00     07:00 - 15:0007:00 - 15:00     07:00 - 15:00
10North Wing07:00 - 14:30EEN    07:00 - 14:3007:00 - 14:30     07:00 - 14:3007:00 - 14:30 
11North Wing14:45 - 22:00RN  14:45 - 22:0014:45 - 22:0014:45 - 22:00    14:45 - 22:0014:45 - 22:0014:45 - 22:00  
12North Wing15:00 - 21:00RN              
13North WingA07:00 - 14:00PCA       07:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:00
14North WingA07:00 - 14:00PCA       07:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:00
15North WingB07:00 - 14:00PCA  07:00 - 14:0007:00 - 14:00     07:00 - 14:0007:00 - 14:00   
16North WingB07:00 - 14:00PCA  07:00 - 14:0007:00 - 14:00     07:00 - 14:0007:00 - 14:00   
17North WingA07:00 - 15:00PCA     07:00 - 15:0007:00 - 15:00     07:00 - 15:0007:00 - 15:00
18North WingA07:00 - 15:00PCA     07:00 - 15:0007:00 - 15:00     07:00 - 15:0007:00 - 15:00
19North WingB07:00 - 15:00PCA  07:00 - 15:00 07:00 - 15:00    07:00 - 15:00 07:00 - 15:00  
20North WingB07:00 - 15:00PCA  07:00 - 15:00 07:00 - 15:00    07:00 - 15:00 07:00 - 15:00  
2019 report
Cell Formulas
RangeFormula
F4:L20F4=IFERROR(FILTER(Roster!$C$4:$C$63,("VACANT"=Roster!F$4:F$63)*($E4=Roster!$E$4:$E$63)*($A4=Roster!$A$4:$A$63)*($C4=Roster!$C$4:$C$63)*($B4=Roster!$B$4:$B$63)),"")
M4:S20M4=IFERROR(FILTER(Roster!$P$4:$P$63,("VACANT"=Roster!S$4:S$63)*($E4=Roster!$R$4:$R$63)*($A4=Roster!$N$4:$N$63)*($C4=Roster!$P$4:$P$63)*($B4=Roster!$O$4:$O$63)),"")
 
Upvote 1
try this and let me know if this work for what you're looking for
-------------------------
Rosters-Vacancies.xlsx
ABCDEFGHIJKLMNOPQRS
1Vacancy Report
2Week 1Week 2
3AreaSectionHoursRoleMonTueWedThuFriSatSunMonTueWedThuFriSatSun
4Clinical Mngmt09:00 - 17:06CM       09:00 - 17:0609:00 - 17:06     
5Clinical Mngmt07:00 - 15:00RN 07:00 - 15:00      07:00 - 15:00     
6Clinical Mngmt07:00 - 15:00RN 07:00 - 15:00      07:00 - 15:00     
7Clinical Mngmt14:45 - 22:15RN   14:45 - 22:1514:45 - 22:1514:45 - 22:15    14:45 - 22:1514:45 - 22:1514:45 - 22:15 
8Clinical Mngmt22:00 - 07:15RN  22:00 - 07:1522:00 - 07:15     22:00 - 07:1522:00 - 07:15   
9North Wing07:00 - 15:00RN07:00 - 15:00     07:00 - 15:0007:00 - 15:00     07:00 - 15:00
10North Wing07:00 - 14:30EEN    07:00 - 14:3007:00 - 14:30     07:00 - 14:3007:00 - 14:30 
11North Wing14:45 - 22:00RN  14:45 - 22:0014:45 - 22:0014:45 - 22:00    14:45 - 22:0014:45 - 22:0014:45 - 22:00  
12North Wing15:00 - 21:00RN              
13North WingA07:00 - 14:00PCA       07:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:00
14North WingA07:00 - 14:00PCA       07:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:00
15North WingB07:00 - 14:00PCA  07:00 - 14:0007:00 - 14:00     07:00 - 14:0007:00 - 14:00   
16North WingB07:00 - 14:00PCA  07:00 - 14:0007:00 - 14:00     07:00 - 14:0007:00 - 14:00   
17North WingA07:00 - 15:00PCA     07:00 - 15:0007:00 - 15:00     07:00 - 15:0007:00 - 15:00
18North WingA07:00 - 15:00PCA     07:00 - 15:0007:00 - 15:00     07:00 - 15:0007:00 - 15:00
19North WingB07:00 - 15:00PCA  07:00 - 15:00 07:00 - 15:00    07:00 - 15:00 07:00 - 15:00  
20North WingB07:00 - 15:00PCA  07:00 - 15:00 07:00 - 15:00    07:00 - 15:00 07:00 - 15:00  
2019 report
Cell Formulas
RangeFormula
F4:L20F4=IFERROR(FILTER(Roster!$C$4:$C$63,("VACANT"=Roster!F$4:F$63)*($E4=Roster!$E$4:$E$63)*($A4=Roster!$A$4:$A$63)*($C4=Roster!$C$4:$C$63)*($B4=Roster!$B$4:$B$63)),"")
M4:S20M4=IFERROR(FILTER(Roster!$P$4:$P$63,("VACANT"=Roster!S$4:S$63)*($E4=Roster!$R$4:$R$63)*($A4=Roster!$N$4:$N$63)*($C4=Roster!$P$4:$P$63)*($B4=Roster!$O$4:$O$63)),"")

You’re solution would definitely work, thank you for your help! Assuming that you could carry the cells across to return the other cells too? eg Area, Section, Role..

Unfortunately, I’m restricted to Excel 2019 and cannot use the FILTER function.

Do you know of any alternative functions that could work above?

Thanks again,
Jason
 
Upvote 0
Hi happy to see your first post!
I have a few observations and questions though.
It is really really tough to flush out one kind of report from another. Your first report has merged cells and is much like a complex cross tab report.
Do you have a list of data that can make everyone's task regarding your reporting much easier, something with columns like this:
Area=A:A
Section=B:B
Shift Timings=C:C
Role=E:E
Shift Start Date:
Shift Start Time:
Shift End Date:
Shift End time:
(note: the start and end dates/times can also be combined into a Date/Time Value)
Vacant/Present

if you have data like this you can easily make any kind of report on staffing.
Thanks mate! Totally agree with you, unfortunately I don’t have a particular source where the first report is derived from, they are created from scratch for each facility, hence things like the merged cells (however that is purely for aesthetics and can be removed if necessary).

For context, I work in Human Resources, where I would rebuild master rosters, consult employees on new shifts and once everyone is happy with the new roster, I would send this roster to another department which migrates the data to an online scheduling system (lots of manual labour involved hey!).
 
Upvote 0
You’re solution would definitely work, thank you for your help! Assuming that you could carry the cells across to return the other cells too? eg Area, Section, Role..

Unfortunately, I’m restricted to Excel 2019 and cannot use the FILTER function.

Do you know of any alternative functions that could work above?

Thanks again,
Jason
according to the microsoft site here: FILTER function - Microsoft Support, you should be able to use FILTER on excel 2019. that's why i created the formula the way i did. if you're not able to use it, can look for another way.
 
Upvote 0
try this
Rosters-Vacancies.xlsx
ABCDEFGHIJKLMNOPQRS
1Vacancy Report
2Week 1Week 2
3AreaSectionHoursRoleMonTueWedThuFriSatSunMonTueWedThuFriSatSun
4Clinical Mngmt09:00 - 17:06CM       09:00 - 17:0609:00 - 17:06     
5Clinical Mngmt07:00 - 15:00RN              
6Clinical Mngmt14:45 - 22:15RN   14:45 - 22:1514:45 - 22:1514:45 - 22:15    14:45 - 22:1514:45 - 22:1514:45 - 22:15 
7Clinical Mngmt22:00 - 07:15RN  22:00 - 07:1522:00 - 07:15     22:00 - 07:1522:00 - 07:15   
8North Wing07:00 - 15:00RN07:00 - 15:00     07:00 - 15:0007:00 - 15:00     07:00 - 15:00
9North Wing07:00 - 14:30EEN    07:00 - 14:3007:00 - 14:30     07:00 - 14:3007:00 - 14:30 
10North Wing14:45 - 22:00RN  14:45 - 22:0014:45 - 22:0014:45 - 22:00    14:45 - 22:0014:45 - 22:0014:45 - 22:00  
11North Wing15:00 - 21:00RN              
12North WingA07:00 - 14:00PCA       07:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:0007:00 - 14:00
13North WingB07:00 - 14:00PCA              
14North WingA07:00 - 15:00PCA              
15North WingB07:00 - 15:00PCA              
2019 report
Cell Formulas
RangeFormula
F4:L15F4=IF(INDEX(Roster!$F$4:$L$63,MATCH($E4&$C4&$A4&$B4,Roster!$E$4:$E$63&Roster!$C$4:$C$63&Roster!$A$4:$A$63&Roster!$B$4:$B$63,0),MATCH(F$3,Roster!$F$3:$L$3,0))="VACANT",$C4,"")
M4:S15M4=IF(INDEX(Roster!$S$4:$Y$63,MATCH($E4&$C4&$A4&$B4,Roster!$R$4:$R$63&Roster!$P$4:$P$63&Roster!$N$4:$N$63&Roster!$O$4:$O$63,0),MATCH(M$3,Roster!$S$3:$Y$3,0))="VACANT",$C4,"")
 
Upvote 1

Thanks Loki, your formula certainly worked!!! It just requires an update to make it portable and show Area, Section, Hours, Role?


Essentially, find "VACANT" return the corresponding: Area, Section, Hours, Role


Removing the hardcoded text in A:A to E:E produces the result below.

Cell Formulas
RangeFormula
F4:L15F4=IF(INDEX(Roster!$F$4:$L$63,MATCH($E4&$C4&$A4&$B4,Roster!$E$4:$E$63&Roster!$C$4:$C$63&Roster!$A$4:$A$63&Roster!$B$4:$B$63,0),MATCH(F$3,Roster!$F$3:$L$3,0))="VACANT",$C4,"")
M4:S15M4=IF(INDEX(Roster!$S$4:$Y$63,MATCH($E4&$C4&$A4&$B4,Roster!$R$4:$R$63&Roster!$P$4:$P$63&Roster!$N$4:$N$63&Roster!$O$4:$O$63,0),MATCH(M$3,Roster!$S$3:$Y$3,0))="VACANT",$C4,"")
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

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