How do I indicate in 1 cell the equivalent of: =IF A2>0, A2*$A$1 or IF B2>0, B2*$B$1?

This formula obviously doesn’t work, but I need to know what will!

  • =IF (A2>0;A2*$A$1;IF (B2>0;B2*$B$1))

or

  • =IF (A2>0;A2*$A$1;IF (B2>0;B2*$B$1;""))

Information:

The question is incomplete or misleading. There are neither complete alternatives nor an explanation about the role of the “or”.
@KentonB: Please try to ask clear questions with sufficiently complete explanations. This site is not made to grant everyone his personal tutorial or optimised lessons about LibreOffice.

@Grantler: You need to apply the tool for inline code to get displayed special characters (the asterisk e.g.) otherwise interptreted as layout commands.

The IF() function expects three parameters: =IF(Condition; ThenExpression; ElseExpression). There are specifications what IF() should return if the ElseExpression is missing or even the ThenExpression is also missing, but it’s not recommendabel to rely on these except in very special cases where you know very exactly what you want to achieve by these garbled function calls.

The standard parameter delimiter of LibreOffice correctly interpreted under any locale is the semicolon.