Sum function and Math Equation Help

Hi all,

So math has never been my strength.

I have bought some of tomatoes (1,032 kg) while on sale (EUR 0.69/500g).
What’s the correct SUM=( ) for me to calculate the cost per unit, against my purchased amount of 1,032 kg?)

I’m feeling like I need to revisit Algebra.


OK, I’ll bite. I’m generally forgiving of “lazy” posts, but…

It seems you do.

This (and your other posts) smell of someone trying to get their homework done by AskLO contributors.


  • you don’t need =SUM(…), you are not adding anything up.

  • If you know the cost of 500g, you know the cost per kilo (how many 500g in a kilo?)

You would also benefit greatly by reading the Calc Guide.

I’ll leave it as an exercise for the reader to find the download location (Google can find it in 0.47s using search terms “libreoffice calc guide”).

I can solve for it, as follows:

1,032kg = 1032g. Now they’re in the same unit.
500g/EUR 0.69 = EUR 0.00138/gram
EUR 0.00138 x 1032g = EUR 2.4633

Where I struggle is making it into a one-liner for LO Calc. I’m not doing homework, this is for real life. I’ve saved up about 40 grocery store receipts, and thought I’d start tracking my spending and cooking. That’s all. I’m sorry if I came off as a student, but I’m absolutely not.


1 Like
  1. Calc can’t handle units. Everything needs to be expressed in the “appopriate unit”.
  2. SI units (like g) always are denoted with their specified abbreviations (and without plural).
  3. Never miss to estimate results gotten by formulas for their plausibility before you start to multiply apply the formula! In your case the result you got (2.46 EUR) is obviously wrong! Would you actually pay that price?
  4. Not in Calc, but in mind or on a sheet of paper check if the units occurring in an equation taken without the accompanying numbers fulfil it by the rules of arithmetic/algebra as if they are numbers being multiplied or divided,. (You never can add or subtract units!). You need to take the units thorughly then, probably not as they are spoken in the village.
    (And: If the equation is correct in units, the formula can still be wrong by any purely numeric factor.)
  5. In case of prices never forget to apply the appropriate rounding.

If interested in an example (Excuse the term “teaching”. My profession seems to be an incurable illness):
teachingAboutPriceCalculation.ods (16.5 KB)

Please tell me where I am wrong or explanations are too bad.

In that case, @DarkArmadillo, I apologise unreservedly. The “old” AskLO used to get a lot of posts from youngsters trying to get homework help :roll_eyes:

In my locale the , is the thousands separator, so I thought you were talking about approx. a tonne of tomatoes!

You also used . as the decimal separator for Euros (is that correct?).

Go for the answer provided in the comment from @PKG.

Sorry, I should’ve prefaced by saying I moved from USA to NL, and at times erroneously interchange , and . when doing currencies. The Dutch use , for a decimal, and a . for the thousands seperator;
whereas the US do the inverse. Doing mental gymnastics, which based on my post history, you’d have seen I tend to do this error to a fault (pun intended).

I guess my biggest question at this point, is…
Does there exist a one-liner formula that can convert Xkg to Xg, while solving my initial equation question?

1 Like

Thanks. Is LO Calc smart enough to know Order of Operations? Or do we need to do like this:

The “x” is not an operator. You need to use “*”.
The precedence of operations is basically like it’s teached in schools (what I can’t confirm for all the world, of course. And ther are a few “doubts” concerning the distinction between the “-” as a sign and as the “change-sign-operator” with effect to the right.
In your example anyway the second pair of parentheses is indispensable: there is no relative prioritizing concerning the operators “*” and “/”. They are simply evaluated left to right.

Don’t use “thousands separators” at all. For bad reasons spreadsheets of any brand only support the separators explicitly deprecated by the applicable ISO standard. The recommended small space is not supported in this role.The way they are, thousands separators only help to increase confusion in data exchange.I can’t change that.

As already told, spredsheets can’t handle units directly. If you have a number in a column dedicated to weights given in kg, and you want to get the appropriate number giving the same weights in g, you simply have to multiply with 1000. (1 kg = 1000 g).

There is a standard function CONVERT() for the pupose, but I doubt if it is very useful. You may try it.

Weirdest thing (and reason for denoting the “x”) was when I wrote the comment out, in the Preview Pane of this forum, the * didn’t show. Thanks

Ugh. I just counted the receipts: 32 in total, across 3 different stores, some with many items, and some with just a handful. This is going to take forever. I started collecting them on 23JUL2022, and figured I’d collect until 23AUG2022 for a month’s snapshot. I planned on doing this every month moving forward.

No apologies necessary. I made an assumption based on hasty reading.

Do you see where the algebra of @PKG is coming from?

It translates as: =((Weight in Kg multiplied by 1000) divided by 500) all multiplied by (Cost per 500g)

If you are still stuck, please add a comment to this post. We’ll get there :slightly_smiling_face:

1 Like

That is because * asterisk characters are used to intro/outro italics and bold markup by this discourse software and a reason why all code including formula expressions should be marked as code, either a short fragment enclosed in single backticks or entire lines surrounded with ``` triple backtick lines, see also This is the guide - How to use the Ask site? - #6 by erAck .

1 Like