ValQ - Plan
FormulaProductChangelogStart Trial
  • Introduction to ValQ
    • Get ValQ
    • The ValQ Workflow
  • Model
    • Get Data
    • Create Model
      • Dynamic Model
      • Custom Model
      • Import a Model
    • Model Editor
      • Node Operations
      • Editor Features
    • Node Settings
    • Templates
      • Apply Template
      • Manage Template Nodes
      • Import Template
      • Export Template
    • Formula Functions
      • Logical Functions
        • IF
        • SWITCH
        • AND
        • OR
        • NOT
        • XOR
        • IFNAN
      • Math Functions
        • SUM
        • SUBTRACT
        • PRODUCT
        • DIVISION
        • AVERAGE
        • AVERAGEEXZERO
        • AVERAGEEXNEG
        • AVERAGEEXZERONEG
        • COUNT
        • ABS
        • MIN
        • MAX
        • POWER
        • SQRT
        • EXP
        • LOG
        • ROUND
        • FLOOR
        • CEILING
      • Finance Functions
        • IRR
        • NPV
        • PMT
        • IPMT
        • FV
        • PV
        • CUMIPMT
        • CUMPRINC
        • RATE
      • Range Functions
        • RANGE
        • LastNPeriods
        • Get
        • ForEach
        • findByTitle
        • GETCURRENTRANGE
        • GETROWVALUE
        • THIS_SOURCE_KEY
        • PERIOD_LOOKUP
        • PRIOR_SERIES_PERIOD_LOOKUP
      • Static Identifiers
        • THIS/ME
        • CURRENT_SERIES*
        • CURRENT_SERIES_ID*
        • CURRENT_PERIOD_INDEX
        • CURRENT_NODE_VALUES
        • DS.SERIES
      • Node Properties
        • Node Properties Explanation
    • Global Settings
  • Plan
    • Create New Plan
    • Time Series Forecasting
    • Allocation Features
      • Goal Seek
      • Distribute
      • Copy to Periods
    • Driver Based Planning
      • Enabling Driver Based Plan
      • Configuring Driver Inputs
      • Bulk Configuration of Drivers
    • Plan Interface
  • Simulate
    • Create a Scenario
    • Perform Simulations
    • Manage Scenarios
    • Simulation Interface
    • Add Notes
    • Compare Scenarios
    • Scenario Analysis by Node
    • Create Initiatives in a Scenario
      • Steps to create initiatives
    • Create your Presentation
    • Understanding the Node Components
  • Report
    • Variance Analysis Report
  • ValQ Premium FAQs
  • Glossary
  • Resources
  • Release Notes
Powered by GitBook
On this page
  • Syntax
  • Arguments
  • Return Value
  • Remarks
  • Example
  • Result
  1. Model
  2. Formula Functions
  3. Logical Functions

IF

An IF statement returns a value depending on whether the condition that is being evaluated is TRUE or FALSE.

Syntax

IF(logical_test, value_if_true, value_if_false)

Arguments

Arguments
Data Type
Condition

logical_test

Text / Number

The condition to be evaluated.

value_if_true

Node reference / Number

The value to be returned if the condition is met.

value_if_false

Node reference / Number

The value to be returned if the condition is not met.

Return Value

Either value_if_true or value_if_false.

Remarks

  1. Returns Blank when the formula is misspelled.

  2. The specified node should contain Numerical data.

  3. The IF function returns error in any of the following cases:

  • value_if_false argument is missing.

  • The argument value_if_true or value_if_false are not of numeric data type.

  • Not using appropriate operator in logical_test.

Example

Consider the Revenue and Cost of Goods Sold nodes to follow the trend as shown below.

Parameter
Jan
Feb
Mar
Apr
May
Jun

Revenue

100

124

137

0

23

45

Cost of Goods Sold

25

25

25

25

25

25

Now, a new node Gross Profit Margin can be computed using the IF function. Gross Profit Margin is calculated as (Revenue-Cost of Goods Sold)/Revenue. In case Revenue has period value of 0, Gross Profit Margin should return 0.

To achieve this, the following formula should be written in the [Gross Profit Margin] node:

IF([Revenue]==0,0%,([Revenue]-[Cost of Goods Sold])/[Revenue])

Result

Parameter
Jan
Feb
Mar
Apr
May
Jun

Gross Profit Margin

75%

80%

82%

0%

-9%

44%

As you can see from the above table, if the logical test condition (Revenue==0) is True, it returns 0, i.e. the gross profit margin is 0 and if the logical test condition is False (Revenue is a non-zero number), it calculates the Gross Profit Margin from the formula and returns it.

Use SWITCH function instead of nesting multiple IF functions.

PreviousLogical FunctionsNextSWITCH

Last updated 1 year ago