0
0
Tableaubi_tool~10 mins

Logical functions (IF, IIF, CASE) in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sales amounts in column A. Column B will categorize sales as 'High', 'Medium', or 'Low' using logical functions.

CellValue
A1Sales
A2150
A380
A4200
B1Category
B2
B3
B4
Formula Trace
IF [Sales] >= 150 THEN 'High' ELSEIF [Sales] > 100 THEN 'Medium' ELSE 'Low' END
Step 1: Check if Sales >= 150 for A2 (150 >= 150)
Step 2: Result for A2 is 'High'
Step 3: Check if Sales >= 150 for A3 (80 >= 150)
Step 4: Check if Sales > 100 for A3 (80 > 100)
Step 5: Result for A3 is 'Low'
Step 6: Check if Sales >= 150 for A4 (200 >= 150)
Step 7: Result for A4 is 'High'
Cell Reference Map
    A       B
1 | Sales | Category
2 | 150   | ?
3 | 80    | ?
4 | 200   | ?
The formula reads Sales values in column A and writes categories in column B based on logical conditions.
Result
    A       B
1 | Sales | Category
2 | 150   | High
3 | 80    | Low
4 | 200   | High
Column B shows the category assigned by the IF formula for each Sales value.
Sheet Trace Quiz - 3 Questions
Test your understanding
What category does a Sales value of 150 get?
AHigh
BMedium
CLow
DNone
Key Result
IF condition1 THEN result1 ELSEIF condition2 THEN result2 ELSE result3 END assigns categories based on value ranges.