LibreOffice Writer: error when formula in text document refers to another formula result

I have a table in my text document. Cell B2 contains the formula =dollarsPerHour*totalHours. The result is calculated and displayed correctly. Cell B3 contains plain text $48.70.

If cell B4 contains the formula =100+<B3>, it correctly displays $147.70. However if cell B4 contains the formula =<B2>+<B3>, it displays an error: ** Expression is faulty **.

Is It not possible for a formula to refer to a cell which contains another formula?

Please upload an ODF type sample file here.

LO 7.5.8

Writer formulas.odt (9.7 KB)

expression_is_faulty.odt (14.5 KB)

The field value, from table’s point of view, is a text. As a whole: including any formatting applied by the field internally. This is different compared to the formatting applied by the table. So, it simply can’t convert the text $780.00 to number 780. If you change the number format of the field to some general number, it would calculate correctly (after forced recalc, like F9 in B4).

Thanks @mikekaganski. So, is it possible in a different way to format the number as currency AND use the calculation?

Define the variables before the table, and use them in the normal table’s formula, not in field. You may make the definitions hidden, if needed.

You can create an invoice in the LO Calc application too. You can format the Calc Cells as you need it. And you can edit/format the textual part too.