Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE.
Name | Type | Description |
arg1 | boolean | Is any value or expression that can be evaluated to TRUE or FALSE. |
arg2 | any | Is the value that is returned if Logical_test is TRUE. If omitted, TRUE is returned. You can nest up to seven IF functions. |
arg3 | any | Is the value that is returned if Logical_test is FALSE. If omitted, FALSE is returned. |
builder.CreateFile("xlsx"); var oWorksheet = Api.GetActiveSheet(); var oFunction = Api.GetWorksheetFunction(); oWorksheet.GetRange("A1").SetValue(oFunction.IF("12<100", 0, 1)); builder.SaveFile("xlsx", "IF.xlsx"); builder.CloseFile();