L
Legacy 428781
Guest
I want to calculate the weighted average of a set of data.
At the end of each time block a value will be entered.
The time blocks are all worth different amounts with Time A being 2.5 hours, Time B is 3.5 hours and Time C is 3 hours.
I want the average to include a cell containing 0.
I want the average to not include empty cells and as a consequence to not include that time block in the calculation.
So using the example below, as Time C is blank I want it to do a weighted average of 9 and 3 with 2.5 and 3.5 and therefore ignore the blank cell and 3.0.
If however Time C said 0, I want it to do a weighted average of 9, 3 and 0 with 2.5, 3.5 and 3.
[TABLE="width: 206"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD]Block[/TD]
[TD]Speed[/TD]
[/TR]
[TR]
[TD="align: right"]2.5 [/TD]
[TD]Time A[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD="align: right"]3.5 [/TD]
[TD]Time B[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD="align: right"] 3.0 [/TD]
[TD]Time C[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Avg
=AVERAGE(C3:C5) doesn't take into account the weights of the time blocks, ignores blank cells and includes 0 in the calculation.
=SUMPRODUCT(C3:C5,A3:A5)/SUM(A3:A5) takes into account the weights but if a cell is blank still divides by the sum of the 3 time blocks when only 1 or 2 of those time blocks are applicable.
=AVERAGEIF(C3:C5,"<>0") doesn't take into account the weight of the time blocks, ignores blank cells and includes 0 in the calculation.
What formula would take into account the weights, include 0 in the calculation and ignore blank cells and its associated time block?
Essentially I want a single formula which will update the average as the current average for the day as data is entered into the rows above.
At the end of each time block a value will be entered.
The time blocks are all worth different amounts with Time A being 2.5 hours, Time B is 3.5 hours and Time C is 3 hours.
I want the average to include a cell containing 0.
I want the average to not include empty cells and as a consequence to not include that time block in the calculation.
So using the example below, as Time C is blank I want it to do a weighted average of 9 and 3 with 2.5 and 3.5 and therefore ignore the blank cell and 3.0.
If however Time C said 0, I want it to do a weighted average of 9, 3 and 0 with 2.5, 3.5 and 3.
[TABLE="width: 206"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD]Block[/TD]
[TD]Speed[/TD]
[/TR]
[TR]
[TD="align: right"]2.5 [/TD]
[TD]Time A[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD="align: right"]3.5 [/TD]
[TD]Time B[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD="align: right"] 3.0 [/TD]
[TD]Time C[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Avg
=AVERAGE(C3:C5) doesn't take into account the weights of the time blocks, ignores blank cells and includes 0 in the calculation.
=SUMPRODUCT(C3:C5,A3:A5)/SUM(A3:A5) takes into account the weights but if a cell is blank still divides by the sum of the 3 time blocks when only 1 or 2 of those time blocks are applicable.
=AVERAGEIF(C3:C5,"<>0") doesn't take into account the weight of the time blocks, ignores blank cells and includes 0 in the calculation.
What formula would take into account the weights, include 0 in the calculation and ignore blank cells and its associated time block?
Essentially I want a single formula which will update the average as the current average for the day as data is entered into the rows above.