Counting Issues!

Mrupe86

New Member
Joined
Jun 22, 2024
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am struggling with the creation of the scheduling table. Unfortunate for me, my company does not have a team to help build spreadsheets. I have a schedule, which uses a code, to signify where the employee will work for the day. The code has a key that matches the job duty and hours. I would like to count each occurrence of the key code as the corresponding shift hour, so that I may sum it as hours worked per week. These are also two separate tables. Table 5 (schedule) and Table 7 (Key)

I can use [=IFERROR(XLOOKUP([@[Exclusive Position Control/Relief]],Table7[Schedule Code:],Table7[Shift Hours]),0)*5] , but when an the relief employee works T1, G1 and H4 I can't get them to add together.
Any suggestions would be greatly appreciated!



Screenshot 2024-11-14 145811.jpg
Screenshot 2024-11-14 145848.jpg
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
We can't manipulate and test with images. Please post your data in a copy-able format. Mr.Excel has XL2BB tool which makes it easy to exchange snipets of your worksheet.

Example:
Book1
ABCDEFGHIJKLM
1Component NameReplacement IntervalComponent Cost
2Component 12000$ 3,000
3Component 23000$ 7,000
4Component 33000$ 8,500
5Component 42500$ 4,000
6
7JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
8Accumulated Equipment Hours2,5432,8763,3513,8204,3524,7625,2735,6946,1506,6187,2377,651
9Cost$ 7,000$ -$ 15,500$ -$ 3,000$ -$ 4,000$ -$ 18,500$ -$ -$ 4,000
Sheet4
Cell Formulas
RangeFormula
B9:M9B9=SUMPRODUCT(QUOTIENT(B8,+$B$2:$B$5),$C$2:$C$5)-SUM($A$9:A9)
 
Upvote 0
Position Control TEMPLATE.xlsx
DEFGHIJKLMNOPQRSTUVWXYZAA
3Total Scheduled Productive Hours Wk 1Total Scheduled Productive Hours Wk 2Total Scheduled Productive Hours Name21/121/11/24/74/84/94/10Column14/114/124/134/144/154/164/17Position:Counted on ScheduleSchedule Code:Shift Hours
44040Jane DoeT1XT1T1XT1T1T1T1XXT1T1T1Tray14T18
54040John DoeT2T2XXT2T2T2T2XT2T2XT2T2Tray12T28
600Chris PrattXT1G1G1T1XXXT2T1T1T2XXHost0H128
74040Chris HansonP1P1P1P1P1P1P1P1P1P1Host4H28
82020Troy PsyE1E1H2H2XXP1E1E1H2H2XXP1Dish2G14
92020Ali FrankDish0G24
104040VacantCook4E18
114040VacantCook0E28
124040Jennifer FreezeHost0H38
132525VacantHost0H45
142525VacantProduction12P15
152525VacantProduction0P25
1600Day Off18X0
Master Scheduler
Cell Formulas
RangeFormula
D4:D16D4=IFERROR(XLOOKUP([@[Exclusive Position Control/Relief]],Table7[Schedule Code:],Table7[Shift Hours]),0)*5
F4:F16F4=[@[Total Scheduled Productive Hours Wk 1]]+[@[Total Scheduled Productive Hours Wk 2]]
Y4:Y16Y4=COUNTIF(Table5[[1/12]:[4/17]],[@[Schedule Code:]])
Named Ranges
NameRefers ToCells
ScheduleCodes=Table7[Schedule Code:]Y4, D4:D16
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:C54,E4:V54Cell Valuecontains "X"textNO
Cells with Data Validation
CellAllowCriteria
H4:N16List=ScheduleCodes
P4:V16List=ScheduleCodes
 
Upvote 0
Thanks for the XL2BB. See if this works for you:
Book1
CDEFGHIJKLMNOPQRSTUVWXYZAA
1Total Scheduled Productive Hours Wk 1Total Scheduled Productive Hours Wk 2Total Scheduled Productive HoursName212-Jan1-Jan2-Jan7-Apr8-Apr9-Apr10-AprColumn111-Apr12-Apr13-Apr14-Apr15-Apr16-Apr17-AprPosition:Counted on ScheduleSchedule Code:Shift Hours
2T1404080Jane DoeT1XT1T1XT1T1T1T1XXT1T1T1Tray14T18
3T2404080John DoeT2T2XXT2T2T2T2XT2T2XT2T2Tray12T28
4Relief243256Chris PrattXT1G1G1T1XXXT2T1T1T2XXHost0H128
5H2252550Chris HansonP1P1P1P1P1P1P1P1P1P1Host0H28
6Dish2G14
7Dish0G24
8Cook0E18
9Cook0E28
10Host0H38
11Host0H45
12Production10P15
13Production0P25
14Day Off14X0
Sheet9
Cell Formulas
RangeFormula
D2:D5D2=SUM(COUNTIFS(H2:N2,$Z$2:$Z$14)*($AA$2:$AA$14))
E2:E5E2=SUM(COUNTIFS(P2:V2,$Z$2:$Z$14)*($AA$2:$AA$14))
F2:F5F2=SUM(D2:E2)
Y2:Y14Y2=COUNTIFS(H2:V5,Z2:Z14)
Dynamic array formulas.
 
Upvote 0
Solution
Thanks for the XL2BB. See if this works for you:
Book1
CDEFGHIJKLMNOPQRSTUVWXYZAA
1Total Scheduled Productive Hours Wk 1Total Scheduled Productive Hours Wk 2Total Scheduled Productive HoursName212-Jan1-Jan2-Jan7-Apr8-Apr9-Apr10-AprColumn111-Apr12-Apr13-Apr14-Apr15-Apr16-Apr17-AprPosition:Counted on ScheduleSchedule Code:Shift Hours
2T1404080Jane DoeT1XT1T1XT1T1T1T1XXT1T1T1Tray14T18
3T2404080John DoeT2T2XXT2T2T2T2XT2T2XT2T2Tray12T28
4Relief243256Chris PrattXT1G1G1T1XXXT2T1T1T2XXHost0H128
5H2252550Chris HansonP1P1P1P1P1P1P1P1P1P1Host0H28
6Dish2G14
7Dish0G24
8Cook0E18
9Cook0E28
10Host0H38
11Host0H45
12Production10P15
13Production0P25
14Day Off14X0
Sheet9
Cell Formulas
RangeFormula
D2:D5D2=SUM(COUNTIFS(H2:N2,$Z$2:$Z$14)*($AA$2:$AA$14))
E2:E5E2=SUM(COUNTIFS(P2:V2,$Z$2:$Z$14)*($AA$2:$AA$14))
F2:F5F2=SUM(D2:E2)
Y2:Y14Y2=COUNTIFS(H2:V5,Z2:Z14)
Dynamic array formulas.
Thank you very much! I was able to change the formulas to the column header and bam! Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,224,795
Messages
6,180,993
Members
453,011
Latest member
Osamu9Dazai

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