Conflict between STYLE() & CURRENT() when a style timer is utilised, why?

=A22+B22+STYLE(IF(CURRENT()>10;“bad”;“error”))
=C18+STYLE(IF(CURRENT()>45;“bad”;“error”))
=C22+STYLE(“bad”;5;“error”)
All work as expected but,
=C18+STYLE(IF(CURRENT()>45;“bad”;5;“error”))
produces Err:504
Is it me?

504 = Parameter list error - Function parameter is not valid, for example, text instead of a number, or a domain reference instead of cell reference.


Error Codes in LibreOffice Calc

In this case it is BETTER to use the Conditional Formatting feature…

Too many parameters of the IF()

The IF() syntax contains 3 parameters only:
=IF(condition;value when it true;value when it false)
Online help

Try to nested IFs, or use the CF feature instead of the STYLE() function.

1 Like

Yeah, I see it now. I was just reading through the function definitions and it looked interesting enough with which to experiment.
I Never really analysed the IF() context, just pasted the STYLE() example. Everybody is advising for conditional formatting so I think I’ll stick with that. Thanks for your endeavours

Sorry… i clicked on the green “Solution” icon accideltally, and it disappeared…

That’s odd, I just clicked on it and it came back :wink: