Sum of items: Get sum of all items to calculate one item

Solved1.10K viewsFormulas and Functionsbasic techniques

Hi there,

I very often come along this question, which should be simple to answer. Each time I fail. And do an easy workaround. BUT … how can this be done nicely?

Typical examples:

  1. Calculate ratio of total:  Ratio:Item1 = Value:Item1 / sum (All Items)
  2. Re-Scale percentage User-Input to 100%   (My case below)
    Final:Percentage:Comp1 = Unscaled:Percentage:Comp1 / sum (Unscaled:Percentage:AllComponents)
    (I could write all components like “Comp1..Comp7”, but this is not scaling when category grows.)
    I tried – unsucessfully: forcelist ….Any ideas???

Thanks, Gilbert

Gilbert Edited question March 8, 2023

Hi S A U,

Thank you very much for your suggestion. It perfectly works!

Lyndsey earlier suggested to me to use “summary”.

It looks to me that all three variants

Final = Unscaled / sum ( forcelist (Unscaled:Comp:Percentage) )

Final = Unscaled / sum ( summary (Unscaled:Comp:Percentage))

Final = Unscaled / sum (Unscaled:Comp:Percentage)

work exactly the same. Thus “summary” / “forcelist” are not needed (there might be cases which a simple “sum” does not work, and these additional functions might help, I don’t know. If somebody has case, please show us the example).

BUT: the important bit – and this was the point I always struggled with: “sum” can only work if you tell it along which category to take the sum. So in my case, the magic is to add the category “Comp” in the cell reference.

I compiled a very simple model to show different cases (sum, average, and sum along two categories) for better understanding. Hope this helps somebody.

And S A U: you won the prize again! Thanks.


Gilbert Answered question February 9, 2023
You are viewing 1 out of 3 answers, click here to view all answers.

Latest Questions