Libre Calc - How to clear a cell from a formula in another cell?

I’m a bit of a newbie at this, so please forgive me if this seems obvious …

I have a cell that is either blank or contains a simple string (a tracking number).
In another cell there is a formula into which I need to add code to clear the tracking number in some circumstances.
The problem is that I cannot figure out how to blank a cell from this cell …
How can I do this ??


A Formula is NOT designed for doing something in OTHER Cells

It is possible to type something in a cell, trigger a macro to perform actions.

Post an example file, it’s easier to suggest something.

É possível ao digitar algo em uma célula, acionar uma macro para realizar ações.

Poste arquivo exemplo, fica mais fácil, sugerir algo.

I suspected as such … so, how can I achieve it ???


Post an example file,

This trick is not difficult to implement. Only this is done not with a formula in the adjacent cell, but with the help of Conditional Formatting - specify the conditions under which the value in the cell should “disappear” and apply a style to the cell with a custom format code ;;; (“don’t show anything”)

Remembering that it is only visual, the information is there, if there is a dependent calculation, it does not change.

1 Like

As already mentioned a formula in a cell (“controlling cell”) isn’t allowed to afflict the true content or the true style/format of a different cell.
If a different cell is expected to change its displayed result or appearance due to changes in your controlling cell, the user (you) must organize this with the help of an appropriate formula placed in that different cell or by defining an appropriate ConditionalFormat for a range to which that other cell belongs.
Any attempt to change the true content (as opposed to a formula result) of a cell in consequence of any event like a change in a different cell would require user code, and would again be blocked in cases where that user code was called due to the evaluation of a formula in a cell of the same sheet.
Thus: You need to rethink the design of your sheets.
Note that the suggestion by @JohnSUN based on ConditionalFormatting also would not change the content of “the other” cell, but only its appearance. A formula in a third cell referencing the “other” cell would still find there the original content or formula result even if not displayed at the time.

1 Like