Skip to content

IF

The IF function is used to perform conditional logic. It evaluates a condition and returns one value if the condition is true and another value if the condition is false.

Applicable to

Calculated Columns

Return Value

  • If the condition is true, the function returns the specific value.
  • If the condition is false, the function returns the specific value.

Remark

  • The condition must be a logical expression that evaluates to either true or false.
  • Nested IF functions can be used to create more complex conditional logic.
  • It is important to ensure that the expressions provided are valid and do not produce errors, as this could cause the IF function to fail.

Syntax

IF(<expression>,condition,condition)

IF in Calculated Columns

ParameterDescription
ExpressionA placeholder in a function that is replaced with the column names.
ConditionThe condition to evaluate against the expression.

Steps to use IF in Calculated Columns

  1. Write the IF function. For instance IF(<expression>,condition,condition)
  2. Replace <expression> with VALUE([Column Name]), replace condition with the actual case that you want to evaluate against expression what you expect to return when the condition turns true.Replace the Column Name with the actual name of your column required.
  3. To learn how to add calculated columns in Infoveave, visit the section Calculated Columns.

Example

Objective Consider you want to create a sales bucket to categorize the unit price on the below table.

DateRegionState or ProvinceSales
01-07-2024WestWashington94.56
02-07-2024WestCalifornia4390.3665
03-07-2024EastNew Jersey53.8096
04-07-2024CentralMinnesota803.4705

You can use the IF function like

IF(VALUE([Sales])>1000, "Profit", IF(VALUE([Sales])<999 AND VALUE([Sales])>200, "Average", "Loss"))

The new calculated column “Sales Bucket” will return

DateRegionState or ProvinceSalesSales Bucket
01-07-2024WestWashington94.56Loss
02-07-2024WestCalifornia4390.3665Profit
03-07-2024EastNew Jersey53.8096Loss
04-07-2024CentralMinnesota803.4705Average