 # Libre calc error 508 after troubleshooting

Hello,

I use Libre Calc 7.0.1.2, on Ubuntu 18.04.1
I have written this formula in my Libre Calc cell :

=SQRT(SUM(\$C33*(D33-\$D\$62)²,\$C34*(D34-\$D\$62)²,\$C35*(D35-\$D\$62)²,\$C36*(D36-\$D\$62)²,\$C37*(D37-\$D\$62)²,\$C38*(D38-\$D\$62)²,\$C39*(D39-\$D\$62)²,\$C40*(D40-\$d\$62²,\$C41*(D41-\$D\$62)²,\$C42*(D42-\$D\$62)²,\$C43*(D43-\$D\$62)²,\$C44*(D44-\$D\$62)²,\$C45*(D45-\$D\$62)²,\$C46*(D46-\$D\$62)²,\$C47*(D47-\$D\$62)²,\$C48*(D48-\$D\$62)²,\$C49*(D49-\$D\$62)²,\$C50*(D50-\$D\$62)²,\$C51*(D51-\$D\$62)²,\$C52*(D52-\$D\$62)²)))

(trying to calculate a standard deviance for random variables. no, the “stdev” won’t do here, because i need a different probability for each summand.)

it always gives me Error 508, which - as I have read here Error Codes in LibreOffice Calc - LibreOffice Help means “Error: Pair missing”, i.e. “Missing bracket, for example, closing brackets, but no opening brackets”

So I checked, and yep, it seems like there is one bracket too much at the end (in the formula I put above). However, whenever I try to delete a bracket, LibreCalc automatically puts one back in when I press enter, and then gives me the Error 508.

I have tried the same thing in another cell - it seems as if Libre Calc automatically adds or takes away (un)needed brackets until it has the correct amount. Which is nice normally, I guess, but not when LibreCalc miscounts, forces me to take one bracket too much, and then complains via “Error508” that it has too many brackets.

I have closing and opening LibreCalc, hasn’t helped.

Hello @nowadays, Do you replaced all `^2` with `²` to post here? No need to. Next time paste the formula as copied from Calc, it is easiest for you and for the other users in the site. Also semicolon ( as a arguments separator is preferred rather than comma (,).

Hi Leroy. No, I didnt replace ^2with ², my key board does that automatically. But thanks to your comment, i replaced all ² with ^2
and libre calc accepted it and corrected the brackets the correct way this time thanks for your help!

This is the correct version that works now:
=SQRT(SUM(\$C46*(D46-\$D\$75)^2,\$C47*(D47-\$D\$75)^2,\$C48*(D48-\$D\$75)^2,\$C49*(D49-\$D\$75)^2,\$C50*(D50-\$D\$75)^2,\$C51*(D51-\$D\$75)^2,\$C52*(D52-\$D\$75)^2,\$C53*(D53-\$D\$75)^2,\$C54*(D54-\$D\$75)^2,\$C55*(D55-\$D\$75)^2,\$C56*(D56-\$D\$75)^2,\$C57*(D57-\$D\$75)^2,\$C58*(D58-\$D\$75)^2,\$C59*(D59-\$D\$75)^2,\$C60*(D60-\$D\$75)^2,\$C61*(D61-\$D\$75)^2,\$C62*(D62-\$D\$75)^2,\$C63*(D63-\$D\$75)^2,\$C64*(D64-\$D\$75)^2,\$C65*(D65-\$D\$75)^2))

Put the closing parentheses before the comma: `\$C40*(D40-\$d\$62²,`.

`=SQRT(SUM(\$C33*(D33-\$D\$62)^2;\$C34*(D34-\$D\$62)^2;\$C35*(D35-\$D\$62)^2;\$C36*(D36-\$D\$62)^2;\$C37*(D37-\$D\$62)^2;\$C38*(D38-\$D\$62)^2;\$C39*(D39-\$D\$62)^2;\$C40*(D40-\$D\$62)^2;\$C41*(D41-\$D\$62)^2;\$C42*(D42-\$D\$62)^2;\$C43*(D43-\$D\$62)^2;\$C44*(D44-\$D\$62)^2;\$C45*(D45-\$D\$62)^2;\$C46*(D46-\$D\$62)^2;\$C47*(D47-\$D\$62)^2;\$C48*(D48-\$D\$62)^2;\$C49*(D49-\$D\$62)^2;\$C50*(D50-\$D\$62)^2;\$C51*(D51-\$D\$62)^2;\$C52*(D52-\$D\$62)^2))`

Check the mark ( ) to the left of the answer that solves your question.