The range K4:M7 is named “values” for readability and convenience only.

If you don’t want to use a named range, use anabsolute referenceinstead.

The solution above shows matchingdatain green, and matchingvaluesin blue.

Excel formula: Highlight cells that contain one of many

The colors are applied automatically with conditional formatting and will update instantly if values change.

This requires two separate conditional formatting rules, each with its own formula.

Normally,rangerepresents the cells being checked.

Excel formula: Highlight top values

The relative reference to B4 will change at each cell.

To force a single result, we wrap COUNTIF in theSUM function.

This gives us asinglenumeric result the count of the cell value (B4) invalues.

Excel formula: Highlight values greater than

As above, any non-zero result means that B4 is a number in K4:M7.

And any non-zero result triggers the conditional formatting rule and colors the cell.

Highlight matching values (blue)

The above rule highlights numbers indatathat appear invalues.

Excel formula:  Highlight 3 smallest values with criteria

We can easily make a rule to highlight cells invaluesthat contain numbers indata.

Each cell invaluesK4:M7 becomes thecriteriaargument inside COUNTIF while therangeisdata(B4:I15).

As above, COUNTIF returns a single count for each cell invaluesand any non-zero result triggers the rule.

Excel COUNTIF function

Article image

Article image

Article image

Article image