0

I'm working with some really frustrating reporting software that doesn't let me calculate the average by dividing two sums.

To get around this, I need to find a way to get the same result by calculating the average of each value that makes up the sum.

Here's an example:

A   B
1   1
2   
1   
2   
2   
1   1
1   
1   
2   
1   
1   1
15  3

In the above, the sum of column A is 15, and the sum of column B is 3. The result I need is 5 (15/3). But I can't use this method to get this result.

So I'm trying to figure out a calculation for each row that will produce the same result if I either sum or average the total of all these calculations.

For example (obviously the below isn't right but this is the theory):

A   B   C
1   1   1
2       0
1       0
2       0
2       0
1   1   1
1       0
1       0
2       0
1       0
1   1   1
15  3   0.27

In the above, I've divided B by A for each row and then done the average of these calculations, which is 0.27. I need to take the same approach, with a different calculation, to somehow get 5.

Hope this makes sense (fingers crossed that it is even possible),

Thanks!

  • But in your attempted solution you divide and then sum and divide... so why not use them in the correct way? – Mauro ALLEGRANZA Apr 21 '22 at 09:34
  • It seems you're looking for a weighted average. Take the averages calculated by the software for each of the two sets A,B and average those two with appropriate factors (the size of the sets A,B). For instance, if A's average is 10 and B's average is 20 and A has 5 elements and B has 40 elements, the weighted average is $\frac{10\cdot 5 + 20 \cdot 40}{5+40}$. – Snaw Apr 21 '22 at 09:37
  • Thanks! The problem is at no point can I use the total (sum or average) of the sets for further calculations, due to software limitations. Everything I can do needs to happen on each row e.g. A1*B1=C1 or A1/B1=C1, and then I can take either the sum or average of C.

    So I don't think I can calculate the weighted average because I've not got a way to work with the average of A and B in a new calculation. :(

    – Kara Barnes Apr 21 '22 at 10:06

0 Answers0