[]
        
(Showing Draft Content)

IF

This function performs a comparison and returns one of two provided values based on that comparison.

Syntax

IF(valueTest, valueTrue, valueFalse)

Arguments

This function has these arguments:

Argument

Description

valueTest

[Required] Value or expression to evaluate

valueTrue

[Required] Value to return if the test evaluates to true

valueFalse

[Required] Value to return if the test evaluates to false

Remarks

The value of valueTest is evaluated.

  • If it is non-zero (or TRUE), then valueTrue is returned.

  • If it is zero (or FALSE), then valueFalse is returned.

The value of valueTest must be numeric data or evaluated to it, where non-zero values indicate TRUE, and a value of zero indicates FALSE. It may contain one of the relational operators: greater than (>), less than (<), equal to (=), or not equal to (<>).

Example

IF(A3<>2000,1900,2000)

IF(R1C2>65,1000,2000)

IF(C4,B2,B4)

IF(1>2,5,10) gives the result 10

IF(1<2,"dogs","cats") gives the result dogs