Cell should be blank if there is no date in another cell

Libreoffice version 7.0

Hi there,

I’m using this formula to check for the number of days an invoice has been due: =IF(TODAY()>A7,TODAY()-A7, "")

A7 is where the date is entered. O7 is where the above formula is entered and the number of days are displayed.

The formula works fine. However when A7 is blank, I get a number such as 44195 or 44198 in O7.

How do I get O7 to be blank when there is no date in A7? I’'ve tried adding the "" in the formula it does not seem to work.

The Column O also contains conditional formatting with styles, basically colors, for when the number of days exceeds a limit. Not sure if that is relevant.

When an empty cell is referenced in a formula which expects a number, the number 0 is returned. This corresponds to the date 30. dec. 1899, so the condition TODAY()>... will always match.

You need an additional condition to check for date entry present. The ISBLANK() function is meant for this, but that doesn’t handle all possible incarnations of “blank cell”, so I prefer to check for “visually blank” instead.

Try this:

=IF(TRIM(A7)="";"No due date";IF(TODAY()>A7;TODAY()-A7;"Not due"))

Thank you i’ll try this