I don't get it. Wouldn't it be easier to just use a population-weighted standard deviation calculation instead?
Like, STDEV is defined (in excel) as SQRT( sum(x - mean)^2 / (n-1) ) for each x from 1 to n in a range.
So couldn't you just find a weighted average and then run:
=SQRT(sumproduct(total, x - weighted_average, x - weighted_average) / sum(all_apples, -1) )
Something like that? That's like a guess, not something I derived on a sheet of paper properly, so there's a good chance it has holes in it.
But my point is, I feel like you'd have a much easier time adjusting the formula to properly accept the dataset you actually have, rather than trying to message the dataset into some intermediate form to match the way the built-in functions work.
Bookmarks