This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
IF

IF 


 

IF ( valueTest , valueTrue , valueFalse ) 
Parameter Type   Description
valueTest  Expression in Value or expression to evaluate
valueTrue  Expression in Value to return if the test evaluates to true
valueFalse  Expression in Value to return if the test evaluates to false or 0

The IF function performs a comparison and returns one of two provided values based on that comparison. It accepts numeric (boolean) data and returns any data type.

The value of valueTest is evaluated. It must be or evaluate to numeric data, 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 (<>). If valueTest is:

  • not zero (TRUE), then valueTrue is returned.
  • zero (FALSE), then valueFalse is returned.

Example  

You want to evaluate B1, giving the value of sales. 

IF(B1<200,"Declining result","Good result") //"Good result" is written if B1>200



See also 

TRUE

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Formulas

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)