Ask Your Question

Libreoffice Calc basic error:508 when setting formula

asked 2019-06-20 14:41:38 +0200

johnsjs gravatar image

updated 2020-08-23 17:22:32 +0200

Alex Kemp gravatar image

Hi all,

I am trying to set a formula using the net present value function to sum a column of numbers. This is in order to calculate the cost of a rising annuity.

i have separately calculated the column of numbers, but because I only want to sum a certain number of them I need to set the formula precisely.

I have tried the following commands;

Sheet.getCellByPosition(8,12).Formula = "=NPV(H3,G15:G" & 15+lifeExpectancy% & ")*(1+H2)"


Sheet.getCellByPosition(8,12).setFormula("=NPV(H3,G15:G" & 15+lifeExpectancy% & ")*(1+H2)")

where lifeExpectancy% is a positive integer.

Both command place the formula I would expect in the target cell;


But in both cases it doesn't calculate but instead gives me error:508

If I copy and paste the formula into that or any other cell it then calculates as expected.

Is this a bug, or am I doing something wrong?

It seems to work fine with other formulae, and appears to be related to the concatenation of rows being summed. I'd rather not have to iteratively build an array of rows to insert into the formula - can anyone think of another way of doing it please?

I am on version on Windows 10

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-06-20 14:42:58 +0200

Lupp gravatar image
edit flag offensive delete link more


Awesome, thank you. It was changing the comma to a semi colon that fixed it.

johnsjs gravatar imagejohnsjs ( 2019-06-20 14:52:26 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-06-20 14:41:38 +0200

Seen: 282 times

Last updated: Jun 20 '19