Ask Your Question

johnsjs's profile - activity

2020-01-13 08:10:01 +0200 received badge  Famous Question (source)
2019-12-06 01:14:22 +0200 received badge  Notable Question (source)
2019-12-06 01:14:22 +0200 received badge  Popular Question (source)
2019-06-20 15:51:24 +0200 answered a question Is what I want to do possible with LibreOffice Calc?

Yes, it is possible. Some of what you are looking to do is non trivial. Setting a list of options, so they appear as d

2019-06-20 15:19:53 +0200 commented answer Copy cell colour if number match

You can use conditional formatting to apply a colour to all exact matches, and a different colour (or no colour) to non

2019-06-20 14:52:27 +0200 marked best answer Libreoffice Calc basic error:508 when setting formula

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)"

and

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;

=NPV(H3,G15:G25)*(1+H2)

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 6.1.1.2 on Windows 10

2019-06-20 14:52:27 +0200 received badge  Scholar (source)
2019-06-20 14:52:26 +0200 commented answer Libreoffice Calc basic error:508 when setting formula

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

2019-06-20 14:41:38 +0200 asked a question Libreoffice Calc basic error:508 when setting formula

Libreoffice Calc basic error:508 when setting formula Hi all, I am trying to set a formula using the net present value