W
Walter Briscoe
I have some data on which I calculate row and column means.
There are discrepancies when the data is incomplete.
I have simplified the data to show the problem.
I believe it may be possible to use Sumproduct to calculate correct
results. I hope some reader can say how.
I have simple data
A B C D
1 AM PM Means
2 Tuesday 2 2
3 Monday 3 4 3.5
4 Means 2.5 4 3.25/2.75
R2C4 is =Average(B2:C2) and copied down
R4C2 is =Average(B2:B3) and copied across
R4C4 shows the row and column means, and is =Average(B4:C4) & "/" &
Average(D23)
The true value for R4C4 should be 3/3
3 is the result of =Average(B2:C3) and is one way of getting true
values. I want to use row and column means also to produce a true value.
3 is also the result of (R4C2*2+R4C3*1)/3
3 is also the result of (R2C4*1+R3C4*2)/3
=sumproduct(B4:C4,[count(B2:B3),count(C2:C3)])/count(B2:C3)
is roughly what I want in place of =Average(B4:C4).
I could use auxiliary cells in sumproduct but would prefer not to do so.
That is not quite right.
My true data refers to 7 days and 4 time periods -
blood sugars for a week.
There are discrepancies when the data is incomplete.
I have simplified the data to show the problem.
I believe it may be possible to use Sumproduct to calculate correct
results. I hope some reader can say how.
I have simple data
A B C D
1 AM PM Means
2 Tuesday 2 2
3 Monday 3 4 3.5
4 Means 2.5 4 3.25/2.75
R2C4 is =Average(B2:C2) and copied down
R4C2 is =Average(B2:B3) and copied across
R4C4 shows the row and column means, and is =Average(B4:C4) & "/" &
Average(D23)
The true value for R4C4 should be 3/3
3 is the result of =Average(B2:C3) and is one way of getting true
values. I want to use row and column means also to produce a true value.
3 is also the result of (R4C2*2+R4C3*1)/3
3 is also the result of (R2C4*1+R3C4*2)/3
=sumproduct(B4:C4,[count(B2:B3),count(C2:C3)])/count(B2:C3)
is roughly what I want in place of =Average(B4:C4).
I could use auxiliary cells in sumproduct but would prefer not to do so.
That is not quite right.
My true data refers to 7 days and 4 time periods -
blood sugars for a week.