How to have empty cells (not zero) that are used in formulas?

See attached spreadsheet:
example.ods (8.8 KB)

In C4:D4 is data that is used in a formula in F4. My problem is that as soon as I have an empty cell in the form of "" the formula throws an error. You can reproduce this by deleting B4, resulting in an empty C4 (achieved by an IF function).

So my question is: how to have conditional empty cells that can be used in formulas? I bet it is easy, and I just didn’t know what to search for.

For completeness:

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: de-DE (en_US.UTF-8); UI: en-GB
7.6.2-3
Calc: threaded

Try in C4 with: =IF(B4="";0;1)
If you can fiddle with F4: =IFERROR(C4*D4;"")

1 Like

As the title suggests, the cell should be empty and not zero.

Like for the formula in cell B4, you could use an IF in cell F4:

=IF(OR(C4="",D4=""),0,C4*D4)

Another solution, you could format the cell B4 using the format “#” (without the quotes).

1 Like

A sort of solution:
activating the “Treat empty string as zero” option in Detailed Calculation Settings.

2 Likes

Thanks! It is doing exactly what I want.