Calculate percentage in Writer table

How to calculate presentage a percentage in a text table in Writer using formula PHD?

Edit your question to make it understandable. What is this phd tag? Also in = inches?

“presentage” = present age?

Give maximum details, notably your goal. Don’t describe your present solution attempt as you may be on the wrong track but but you expect as a result.

Mention your OS name and LO version.

Don’t use “Add answer” because it is reserved for solution. Use the edit link and, please, retag.

Text tables have no noteworthy capabilities concerning calculations. In addition editing of the few formulas they support at all is unhandy and error-prone. so is formatting of results.
I would guess, it’s mostly simpler to do calculations with a pocket calculator, and to enter the results via the keyboard or -if a “virtual pocket calculator” was used- to copy/paste the results.
You also can use a spreadsheet (Calc) as this kind of “pocket calculator”.
If it comes to real automation concerning calculations in text documents, you need to embed a spreadsheet. This is rather simple, reliable, and powerful. You can even store reusable, partly filled spreadsheets as AutoText entries.
This just seems to not be teached anywhere. (Suppose MS junk can’t do it the easy way?)

1 Like

Typing numbers into a pocket calculator or into a screen calculator is error prone, e.g. transcription error. It is safer to to add within a table, especially a multi-page table where formatted text is the predominant volume.

There is the possibility of error if rows are added after the calculation is made, but that applies to manually calculated totals too. At least with a formula you can press F2 to check all cells are included or to reselect.

I didn’t actually want to suggest the usage of a pocket calculator, but mainly to dissuade from using text tables for calculations. Too poor, too error-prone, imo.

I had this issue a while ago, the answer is to never use phd in a table formula.

Just do the equation, say = <D28> / <E28> then click in the cell and click Table > Number format > Percent.

Please see question Percent calculation in a Writer table. Both answers are worth reading. Cheers, Al

Why not?
Please think commercially. Take a look at my file; it provides in-depth information and clearly demonstrates the differences to the CALC syntax with more statistic and algebraic and logical and mathematic funktions. I spent a whole day researching, testing, and wasting time on it.

1_LO-WRiTER_mathematisch berechnete Feldbefehle aus WRiTER-Tabelle in Text Ăźbertragen_041929.odt (30.2 KB)
My explanations are in German, but the formulas, mathematical operations, and logical algorithms are generally understandable.


A request to the administrators: please link this to old posts, because I suspect other users might find the instructions useful!

Why yes? Writing a strange “PHD” instead of “/100” is OK??? Because that “PHD” is exact replacement for “/100”, and the description of “calculates a percentage” is confusing, misleading, and directly contradicting the very example given right there in the help: 10 + 15 PHD displays 10.15 demonstrates clearly, that 10 + 15 PHD is calculated as 10 + 15 / 100, or to emphasize - 10 + (15 / 100); and it has nothing to do with naive “let me calculate fifteen percent of ten”, which would be 1.5, not 0.15; and “ten plus 15 percent of ten” would better be calculated as 10 * 1.15.

Whenever you put a link to another Q or A or comment into your own post, a mutual link is established (there in the other post, a link to the new post appears).

@koyotak As I explain in the other post, I discovered that PHD is in fact a postscript operator. Unfortunately, it is insufficiently described. In particular, the rare documentation does not tell anything about its precedence relative to others. So, it is very easy to write something leading to “Expression is faulty”. I guess correct usage of it requires parentheses to clearly delimit its range. This is another argument in favor of its rejection in current normal “formulas” as recommended by @EarnestAl.

Think “long term” (this may meet “commercially”). If description and semantics of PHD is inadequate or insufficiently clear, what is your workload to understand the formulas and fix it several years ahead? Then a good ol’ traditional formula (perhaps not concise and “beautiful”) is preferable.

1 Like

…a failure to divide only by 100! The correct formula is: n × (1 + x/100).
The ‘phd’-syntax is inherent of a commercial calculator while the formula above is for a technical calculator.
It took me the longest to understand ‘phd’.

What specifically are you trying to say by that? That Writer has a “failure”? Or that I made a mistake - than where? The PHD in Writer is simply “/100” (or, closer to the code, “*0.01”), period. The name “PHD” implies that, by the way: it’s simply “per hundred”.

I was unable to guess it! Then, it is clearly a “postfix sign”, just like prefix - denotes a negative value (unfortunately, except in APL, there is no distinction between the prefix tag for negative value – and this is intrinsic to a negative number – and the subtraction operator). This explains why applied to a cell reference it leads to “Expression is faulty”. I consider safer to completely drop its usage.

1 Like

Lol. Looking at your Formulas and Syntax in WRiTER tables, I see now that you didn’t understand it in the end, exactly because it does not do what you desperately want it to do :slight_smile: - and that is a really good reason to not use it, “thinking commercially”. I wonder how “commercial” (correct? reliable?) will be all the formulas created following your “n × (1 + x/100)” idea of what it does.

Filed tdf#167580 to remove it from the UI at all.

1 Like

Oh dear!
In fact, Germany (where I am living) follows a very bad tradition of teaching the so-called “percentage calculation”. As I found out years ago (e.g. with questions here from 2018 and 2021), it’s no better in other countries, perhaps even worse.
Fortunately, AI will soon fix it.