# Apply a percentage across a total sum in Calc

Hi.

I have two values and I want to add them together and apply a percentage increase to them, but with the command I'm using, it's only applying the percentage increase to the second value, not the sum of the two.

I use a Spanish configured version of Calc, so here's the command that I use:

=suma(X+Y/100*Z) (where X and Y are the two cells that I wish to add together and Z is the percentage as recorded in another sell).

Using this command, Calc is adding 20% to Y then adding the total of that to X. What I want it to do is add X and Y together then increase their total value by 20%.

edit retag close merge delete

1

A basic math suggests that in expression

X+Y*100*Z


multiplication has greater priority than summation; and one surely knows that brackets should be used to override normal mathematical operator precedence...

( 2020-08-13 10:31:21 +0100 )edit
3

Being open to also improve our basic math concerning what often is called "percenatge" we may need to consider that the topic is badly teached for many decades now - and, as it seems not only in Germany where I know the situation in detail,

From the mathematical point of view the term to use should never be "percentage" but either ratio or probably rate (preferable in some use-cases). Mathematics doesn't prefer the denominator 100 in any way. We only are trained to prefer it when communicating rates or ratios despite the fact that this often is inappropriate.

Using spreadsheets we may enter a ratio/rate as 20% e.g. Calc will recognize this as meaning 0.2 and automatically format the cell to display the value as 20%. Having entered this in, say, cell C2, and having the two addends mentioned in cells A2, B2, the appropriate formula (in ...(more)

( 2020-08-13 12:01:10 +0100 )edit
2

(Continued)
Doing consistently as I described it, you can safely forget all the formulas containing a factor or a divisor of 100.

ratio = change / basevalue
change = basevalue * ratio
basevalue = change / ratio
growthfactor = 1 + (growth)rate
nextvalue = basevalue * growthfactor
...
All the values can also be negative. The interpretaion is obvious.

( 2020-08-13 12:07:40 +0100 )edit

Sort by » oldest newest most voted

In addition to the previous comments, you could, but do not need, to use =SUM (=SUMA in Spanish) in this calculation.

=(X+Y)/100*Z will give the same result as =SUM(X;Y)/100*Z

If, eventually, you need to add the values of more than two cells, =SUM(range) will do the job better.

@Lupp concept is a more elegant way of thinking this math subject, poorly appreciated by the vast majority.

LibreOffice Help on SUM function.