LibreOffice 7.2 Help
āĻŽā§āϞā§āϝāĻžā§āύāĻāĻāϤ āĻāĻā§āϏāĻĒā§āϰā§āĻļāύā§āϰ āϞāĻāĻŋāĻā§āϝāĻžāϞ āĻŽāĻžāύā§āϰ āĻāĻĒāϰ āύāĻŋāϰā§āĻŦāϰāĻļā§āϞ āĻĻā§āĻāĻāĻŋ āϏāĻŽā§āĻāĻžāĻŦā§āϝ āĻĢāĻžāĻāĻļāύ āĻĢāϞāĻžāĻĢāϞā§āϰ āĻŽāϧā§āϝ⧠āĻāĻāĻāĻŋ āĻĒā§āϰāĻĻāĻžāύ āĻāϰ⧠āĻĨāĻžāĻā§āĨ¤
IIf (Expression, ExpressionTrue, ExpressionFalse)
āĻāĻā§āϏāĻĒā§āϰā§āĻļāύ: āϝā§āĻā§āύ⧠āĻāĻā§āϏāĻĒā§āϰā§āĻļāύ āĻāĻĒāύāĻŋ āϝāĻž āĻŽā§āϞā§āϝāĻžā§āύ āĻāϰāϤ⧠āĻāĻžāύāĨ¤ āϝāĻĻāĻŋ āĻāĻā§āϏāĻĒā§āϰā§āĻļāύāĻāĻŋ True āĻšāĻŋāϏā§āĻŦā§ āĻŽā§āϞā§āϝāĻžā§āĻŋāϤ āĻšā§, āϤāĻžāĻšāϞ⧠āĻĢāĻžāĻāĻļāύāĻāĻŋ ExpressionTrue āĻāϰ āĻĢāϞāĻžāĻĢāϞ āĻĒā§āϰāĻĻāĻžāύ āĻāϰ⧠āĻĨāĻžāĻā§, āĻ āύā§āϝāĻĨāĻžā§ āĻāĻāĻŋ ExpressionFalse āĻāϰ āĻĢāϞāĻžāĻĢāϞ āĻĒā§āϰāĻĻāĻžāύ āĻāϰ⧠āĻĨāĻžāĻā§āĨ¤
ExpressionTrue, ExpressionFalse: āϝā§āĻā§āύ⧠āĻāĻā§āϏāĻĒā§āϰā§āĻļāύ, āϝāĻžāϰ āĻāĻāĻāĻŋ āϞāĻāĻŋāĻā§āϝāĻžāϞ āĻŽā§āϞā§āϝāĻžā§āύā§āϰ āĻāĻĒāϰ āύāĻŋāϰā§āĻāϰ āĻāϰ⧠āĻĢāĻžāĻāĻļāύ āĻĢāϞāĻžāĻĢāϞ āĻšāĻŋāϏā§āĻŦā§ āĻĒā§āϰāĻĻāĻžāύ āĻāϰāĻž āĻšāĻŦā§āĨ¤
IIf evaluates both ExpressionTrue and ExpressionFalse even if it returns only one of them. If one of the expressions results in error, the function returns the error. For example, do not use IIF to bypass a possible division by zero result.
REM Returns the maximum of 3 values
Function Max (A As Double, B As Double, C, As Double) As Double
Max = IIf( A >= B, A, B)
Max = IIf( C >= Max, C, Max)
End Function
REM Bad usage of function IIf
Function Inverse(A As Double) As Double
Inverse = IIf( A = 0, 0, 1/A )
End Function