0
0
Tableaubi_tool~10 mins

Color encoding in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sales data by product category

CellValue
A1Category
B1Sales
A2Furniture
B25000
A3Office Supplies
B33000
A4Technology
B47000
Formula Trace
IF [Sales] > 6000 THEN 'Green' ELSEIF [Sales] > 4000 THEN 'Yellow' ELSE 'Red' END
Step 1: Evaluate [Sales] for Furniture: 5000
Step 2: Check if 5000 > 6000
Step 3: Check if 5000 > 4000
Step 4: Assign color 'Yellow' for Furniture
Step 5: Evaluate [Sales] for Office Supplies: 3000
Step 6: Check if 3000 > 6000
Step 7: Check if 3000 > 4000
Step 8: Assign color 'Red' for Office Supplies
Step 9: Evaluate [Sales] for Technology: 7000
Step 10: Check if 7000 > 6000
Step 11: Assign color 'Green' for Technology
Cell Reference Map
    A           B
1 |Category   | Sales  |
2 |Furniture  | 5000   | <-- Sales value used
3 |Office Supplies | 3000 | <-- Sales value used
4 |Technology | 7000   | <-- Sales value used

Arrows point from Sales cells (B2, B3, B4) to color assignment logic.
The formula uses the Sales values in column B (cells B2, B3, B4) to decide color encoding.
Result
    A              B        C
1 |Category      | Sales  | Color  |
2 |Furniture     | 5000   | Yellow |
3 |Office Supplies| 3000  | Red    |
4 |Technology    | 7000   | Green  |
The Color column shows the color assigned based on Sales value thresholds: Green for >6000, Yellow for >4000, Red otherwise.
Sheet Trace Quiz - 3 Questions
Test your understanding
What color is assigned to Furniture with sales of 5000?
ARed
BGreen
CYellow
DBlue
Key Result
Color encoding uses IF-ELSEIF-ELSE to assign colors based on numeric thresholds.