Help with simplifying Weighted AHT formula by Day of Week over 365 days of data

Marklarbear

Board Regular
Joined
Nov 6, 2003
Messages
119
Office Version
  1. 365
Platform
  1. Windows
Hi Brains Trust

What I'm looking to do is reduce the size (and the potential for cell reference error) of the weighted AHT formula that we currently use. The sample below covers 1 month of data - our actual data table covers a full year (01/01/2021 - 31/12/2021).

What we need is a weighted AHT value by day of the week within the date range of the table. Cells in column K does this task, however this formula gets rather large when looking over a 365 day range - is there a way to get the same answers in column K with a more concise formula???

Book1
BCDEFGHIJK
2DateDOWVol ActVol FctAHT ActAHT Fct
301/01/21Fri00
402/01/21Sat177525
503/01/21Sun87610DayWeighted AHT
604/01/21Mon606711Mon733
705/01/21Tue585738Tue679
806/01/21Wed535726Wed717
907/01/21Thu482731Thu690
1008/01/21Fri457637Fri692
1109/01/21Sat181613Sat627
1210/01/21Sun92736Sun698
1311/01/21Mon556714
1412/01/21Tue533645
1513/01/21Wed488678
1614/01/21Thu532658
1715/01/21Fri474661
1816/01/21Sat153632
1917/01/21Sun77629
2018/01/21Mon561726
2119/01/21Tue504648
2220/01/21Wed536693
2321/01/21Thu565657
2422/01/21Fri613720
2523/01/21Sat217635
2624/01/21Sun99647
2725/01/21Mon650775
2826/01/21Tue00
2927/01/21Wed618761
3028/01/21Thu580716
3129/01/21Fri566731
3230/01/21Sat171733
3331/01/21Sun105836
Sheet1
Cell Formulas
RangeFormula
K6:K9K6=SUMPRODUCT(D6*F6+D13*F13+D20*F20+D27*F27)/SUM(D6+D13+D20+D27)
K10:K12K10=SUMPRODUCT(D3*F3+D10*F10+D17*F17+D24*F24+D31*F31)/SUM(D3+D10+D17+D24+D31)




The above is a sample of the data - our 'live' work book looks like this (using Mondays as an example):

Live Data Set.xlsx
H
26716
Summary
Cell Formulas
RangeFormula
H26H26=IFERROR(SUMPRODUCT('Data Set'!$D18*'Data Set'!$F18+'Data Set'!$D25*'Data Set'!$F25+'Data Set'!$D32*'Data Set'!$F32+'Data Set'!$D39*'Data Set'!$F39+'Data Set'!$D46*'Data Set'!$F46+'Data Set'!$D53*'Data Set'!$F53+'Data Set'!$D60*'Data Set'!$F60+'Data Set'!$D67*'Data Set'!$F67+'Data Set'!$D74*'Data Set'!$F74+'Data Set'!$D81*'Data Set'!$F81+'Data Set'!$D88*'Data Set'!$F88+'Data Set'!$D95*'Data Set'!$F95+'Data Set'!$D102*'Data Set'!$F102+'Data Set'!$D109*'Data Set'!$F109+'Data Set'!$D116*'Data Set'!$F116+'Data Set'!$D123*'Data Set'!$F123+'Data Set'!$D130*'Data Set'!$F130+'Data Set'!$D137*'Data Set'!$F137+'Data Set'!$D144*'Data Set'!$F144+'Data Set'!$D151*'Data Set'!$F151+'Data Set'!$D158*'Data Set'!$F158+'Data Set'!$D165*'Data Set'!$F165+'Data Set'!$D172*'Data Set'!$F172+'Data Set'!$D179*'Data Set'!$F179+'Data Set'!$D186*'Data Set'!$F186+'Data Set'!$D193*'Data Set'!$F193+'Data Set'!$D200*'Data Set'!$F200+'Data Set'!$D207*'Data Set'!$F207+'Data Set'!$D214*'Data Set'!$F214+'Data Set'!$D221*'Data Set'!$F221+'Data Set'!$D228*'Data Set'!$F228+'Data Set'!$D235*'Data Set'!$F235+'Data Set'!$D242*'Data Set'!$F242+'Data Set'!$D249*'Data Set'!$F249+'Data Set'!$D256*'Data Set'!$F256+'Data Set'!$D263*'Data Set'!$F263+'Data Set'!$D270*'Data Set'!$F270+'Data Set'!$D277*'Data Set'!$F277+'Data Set'!$D284*'Data Set'!$F284+'Data Set'!$D291*'Data Set'!$F291+'Data Set'!$D298*'Data Set'!$F298+'Data Set'!$D305*'Data Set'!$F305+'Data Set'!$D312*'Data Set'!$F312+'Data Set'!$D319*'Data Set'!$F319+'Data Set'!$D326*'Data Set'!$F326+'Data Set'!$D333*'Data Set'!$F333+'Data Set'!$D340*'Data Set'!$F340+'Data Set'!$D347*'Data Set'!$F347+'Data Set'!$D354*'Data Set'!$F354+'Data Set'!$D361*'Data Set'!$F361+'Data Set'!$D368*'Data Set'!$F368+'Data Set'!$D375*'Data Set'!$F375+'Data Set'!$D382*'Data Set'!$F382)/SUM('Data Set'!$D18,'Data Set'!$D25,'Data Set'!$D32,'Data Set'!$D39,'Data Set'!$D46,'Data Set'!$D53,'Data Set'!$D60,'Data Set'!$D67,'Data Set'!$D74,'Data Set'!$D81,'Data Set'!$D88,'Data Set'!$D95,'Data Set'!$D102,'Data Set'!$D109,'Data Set'!$D116,'Data Set'!$D123,'Data Set'!$D130,'Data Set'!$D137,'Data Set'!$D144,'Data Set'!$D151,'Data Set'!$D158,'Data Set'!$D165,'Data Set'!$D172,'Data Set'!$D179,'Data Set'!$D186,'Data Set'!$D193,'Data Set'!$D200,'Data Set'!$D207,'Data Set'!$D214,'Data Set'!$D221,'Data Set'!$D228,'Data Set'!$D235,'Data Set'!$D242,'Data Set'!$D249,'Data Set'!$D256,'Data Set'!$D263,'Data Set'!$D270,'Data Set'!$D277,'Data Set'!$D284,'Data Set'!$D291,'Data Set'!$D298,'Data Set'!$D305,'Data Set'!$D312,'Data Set'!$D319,'Data Set'!$D326,'Data Set'!$D333,'Data Set'!$D340,'Data Set'!$D347,'Data Set'!$D354,'Data Set'!$D361,'Data Set'!$D368,'Data Set'!$D375,'Data Set'!$D382),"-")


As you can appreciate - a formula this size is open to human error when referencing that many cells.....

Any assistance would be greatly appreciated :)
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
This assumes you plan to keep Monday as the first day listed in the summary, so the WEEKDAY function and the ROWS function are coordinated to return values when Monday=1, Tuesday=2, etc. If you change the order of the days in the summary list, this part of the formula would require revision. Otherwise, just adjust the range covered by the formula in column J to operate over a much longer period of time...comparison shown to your original in column I.
Book1
ABCDEFGHIJ
1
2DateDOWVol ActVol FctAHT ActAHT Fct
31/1/2021Fri00
41/2/2021Sat177525
51/3/2021Sun87610DayWeighted AHTWeighted AHT
61/4/2021Mon606711Mon732.7796732.779604
71/5/2021Tue585738Tue679.47411679.474106
81/6/2021Wed535726Wed717.05099717.050988
91/7/2021Thu482731Thu689.61695689.616952
101/8/2021Fri457637Fri691.71991691.719905
111/9/2021Sat181613Sat627.04338627.043382
121/10/2021Sun92736Sun697.93043697.930435
131/11/2021Mon556714
141/12/2021Tue533645
151/13/2021Wed488678
161/14/2021Thu532658
171/15/2021Fri474661
181/16/2021Sat153632
191/17/2021Sun77629
201/18/2021Mon561726
211/19/2021Tue504648
221/20/2021Wed536693
231/21/2021Thu565657
241/22/2021Fri613720
251/23/2021Sat217635
261/24/2021Sun99647
271/25/2021Mon650775
281/26/2021Tue00
291/27/2021Wed618761
301/28/2021Thu580716
311/29/2021Fri566731
321/30/2021Sat171733
331/31/2021Sun105836
Sheet1
Cell Formulas
RangeFormula
I6:I9I6=SUMPRODUCT(C6*E6+C13*E13+C20*E20+C27*E27)/SUM(C6+C13+C20+C27)
J6:J12J6=LET(darr,--(WEEKDAY($A$3:$A$33,2)=ROWS(H$6:H6)),dow,$C$3:$C$33,SUMPRODUCT(dow,$E$3:$E$33,darr)/SUM(dow*darr))
I10:I12I10=SUMPRODUCT(C3*E3+C10*E10+C17*E17+C24*E24+C31*E31)/SUM(C3+C10+C17+C24+C31)
 
Upvote 0
Let me try that again...I didn't have my sheet set up the same way...and this version avoids the WEEKDAY/ROWS idea and simply matches days to the DOW column so it's even shorter:
MrExcel_20220531.xlsx
BCDEFGHIJ
2DateDOWVol ActVol FctAHT ActAHT Fct
31/1/2021Fri00
41/2/2021Sat177525
51/3/2021Sun87610DayWeighted AHT
61/4/2021Mon606711Mon732.779604
71/5/2021Tue585738Tue679.474106
81/6/2021Wed535726Wed717.050988
91/7/2021Thu482731Thu689.616952
101/8/2021Fri457637Fri691.719905
111/9/2021Sat181613Sat627.043382
121/10/2021Sun92736Sun697.930435
Sheet1
Cell Formulas
RangeFormula
J6:J12J6=LET(darr,N($C$3:$C$33=I6),vol,$D$3:$D$33,SUMPRODUCT(vol,darr,$F$3:$F$33)/SUM(vol*darr))
 
Upvote 0
Let me try that again...I didn't have my sheet set up the same way...and this version avoids the WEEKDAY/ROWS idea and simply matches days to the DOW column so it's even shorter:
MrExcel_20220531.xlsx
BCDEFGHIJ
2DateDOWVol ActVol FctAHT ActAHT Fct
31/1/2021Fri00
41/2/2021Sat177525
51/3/2021Sun87610DayWeighted AHT
61/4/2021Mon606711Mon732.779604
71/5/2021Tue585738Tue679.474106
81/6/2021Wed535726Wed717.050988
91/7/2021Thu482731Thu689.616952
101/8/2021Fri457637Fri691.719905
111/9/2021Sat181613Sat627.043382
121/10/2021Sun92736Sun697.930435
Sheet1
Cell Formulas
RangeFormula
J6:J12J6=LET(darr,N($C$3:$C$33=I6),vol,$D$3:$D$33,SUMPRODUCT(vol,darr,$F$3:$F$33)/SUM(vol*darr))
Cheers KRice - This works brilliantly!!! you are a legend!😄
 
Upvote 0

Forum statistics

Threads
1,223,708
Messages
6,174,006
Members
452,542
Latest member
Bricklin

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