Page 1 of 1

[Solved] If formula returns error show empty cell

Posted: Wed Feb 19, 2025 3:18 am
by Bushido222
Hello Group,

First time here.

I'd like to write a formula such that if the result is an "error", the cell would be left blank. This situation arose when skipping lines in a worksheet but copying a formula to an entire column, thereby having the error (DIV-something) message appearing in every other row.

Many thanks

Re: If "x" then leave cell blank

Posted: Wed Feb 19, 2025 3:26 am
by robleyd
The ISERROR() function is probably what you are looking for. Something like

Code: Select all

=IF ( ISERROR(yourformula) ;"" ;yourformula )

Re: If "formula returns error" then leave cell blank

Posted: Mon Feb 24, 2025 7:49 am
by Zizi64
A cell containing a FORMULA, will not (can not) be really blank. It will be visually blank with an empty string content.

When you use the function ISBLANK() in an another cell (referenced to the cell containing the formula) the result always will FALSE.

Re: [Solved] If formula returns error show empty cell

Posted: Thu Mar 06, 2025 9:19 pm
by Bushido222
Thank you both!

Not sure I've got it yet, but it's not the end of the world.

Re: [Solved] If formula returns error show empty cell

Posted: Fri Mar 07, 2025 6:30 pm
by Lupp
LibreOffice is a still actively maintained branch of the OpenSource OO.o origin. It supports all the features you may be used to, but is developed beyond that.
Concerning this topic. It has functions IFERROR() and IFNA() which help to simplify the solution suggested by @robleyd to

Code: Select all

=IFERROR(yourformula); "")
For the special case that only the error message "#N/A" shall be treated (while other errors should be shown) there would be

Code: Select all

=IFNA(yourformula); "")
If no error occurred, both formulas would return the result of yourformula.
This is mostly advanatageous if yourformula is complicated and/or needs to do a lot of calculations in the backround. Array-formulas are sometimes of that kind.