Skip to content
Learn › Clean and shape data › Highlight values: open the docs menu

Which highlight rule wins when several rules match

Rules in the Conditional Highlights panel are checked from the top down, and the top rule has the highest priority. Drag rule cards to change the order. To create rules, see Highlight cells and rows with colour.

How Mammoth picks the colour for each cell

  1. For each cell, rules are checked from top to bottom.
  2. The first rule that matches the row and applies to that cell colours it. No further rules are checked for that cell.
  3. If no rule matches, the cell has no highlight.

A rule in Cells mode colours only its chosen columns, so lower rules can still colour other cells in the same row.

Rules (top to bottom):
  1. Sales > 10,000  →  Red background
  2. Sales > 5,000   →  Yellow background
  3. Region = "West" →  Blue background
RowResult
Sales = 12,000, Region = "West"Rule 1 matches: red. Rules 2 and 3 are skipped.
Sales = 7,500, Region = "North"Rule 1 doesn't match. Rule 2 matches: yellow. Rule 3 is skipped.
Sales = 2,000, Region = "West"Rules 1 and 2 don't match. Rule 3 matches: blue.

Put your most specific or most important rules at the top.

Color Scales take part in the same order. A Color Scale above a Condition Rule colours every value in its column, so lower Condition Rules can't colour cells there. To let Condition Rules win, put them above the Color Scale.

Example: colour sales reps against a target

The Monthly Sales target is $10,000. You want to see at a glance who hit it, who is close and who missed.

RuleConditionColourPosition
1Monthly Sales >= 10,000Green backgroundTop
2Monthly Sales >= 9,000Yellow backgroundSecond
3Monthly Sales < 9,000Red backgroundThird

Reps at or above target turn green. Reps from $9,000 to $9,999, within 10% of target, turn yellow. Everyone else turns red. A rep at $15,000 matches rule 1 first, so rules 2 and 3 are never checked. For a new target, edit rules 1 and 2. Rule 3 catches everything the first two miss.

Rows with an empty Monthly Sales match none of these rules, because an empty cell doesn't equal a number. Add a fourth rule with is Empty to flag missing data.

Was this page helpful?

Something wrong? support@mammoth.io