=if()elseif() help?

I have a formula; =if(THIS;THAT) which works GREAT.

I would like to add a third parameter; IF() so that when the value of THIS is exceeded, the third parameter is displayed in the cell.

Tried both of these:

=IF(TODAY()-C4>190,"Send Now",TODAY()-C4, "Ready")
=IF(TODAY()-C4>190,"Send Now",TODAY()-C4)elseif (TODAY()>190,"READY")

Both resulted in ERRORs, 504 and 509


Thanks, ⌡im

[erAck: edited to codify using ```, see This is the guide - How to use the Ask site? - #6 by erAck ]

You may want to consider what I wrote in my answer here: Why do I often get an error (508, 504, 502 e.g.) if I paste a Calc formula from some post into my sheet? .

This worked for only on my test cell :thinking:

=IF(TODAY()-C4>190,"Send Now",TODAY()-C4,"READY")

Thanks anyway, ⌡im

[erAck: edited to codify using ``` ]

Have written this formula 100 different ways … Still won’t work

=IFS((C2="","Send Now"),(TODAY()-C2>190,"READY"),(TODAY()-C2))
Col C Col D
20. Feb. 2022 #N/A
10. Jan. 2022 Err:509
30. Dec. 2020 Err:509

Col C is formatted as date and data is entered
Col D is where the fomula is locates and then was copied down

Another question re: formulas: Does CALC continue assessing the formuls after 1 of the arguments = TRUE?
That might explain my problem

More thanks are due.

[erAck: edited to codify using ``` and fix table, again see This is the guide - How to use the Ask site? - #6 by erAck ]

See documentation and function IFS - IFS function


  • I suppose you also wanted to link to IF() .
  • Unfortunately there the paragraph starting with “In the LibreOffice Calc functions,…” isn’t quite correct. It wrongly generalizes a restriction valid for IF(), but not (e.g.) for REGEX(). .

It is correct for all Calc functions. In Calc, whenever you use an argument separator, you set the following argument - unlike some programming languages, where there is a way to use two separators in a row to have corresponding argument unset. In the ;; case, the set argument would be empty parameter (which, again, is different to “missing optional parameter” - see ODF 1.3 part 4 sect. 5.6). The empty parameters may be specified to be handled specially; otherwise, the standard makes it application-defined if they are accepted. Calc treats them as an empty string (in position of a string argument), or 0 (where number is expected), or a matrix with a single 0 element (where matrix is expected). This makes e.g. this different:


(missing second optional parameter is treated as 1, i.e. A1 syntax of reference)


(empty second parameter is treated as 0, i.e. R1C1 syntax of references, making this formula fail)

However, for the IF() function that paragraph is a bad example because it talks of 4 parameters whereas IF() only has 3.