Exceljet

Quick, clean, and to the point

Highlight cells that equal

Excel formula: Highlight cells that equal
Generic formula 
=A1="X"
Summary 

To highlight cells equal to a specific value, you can use conditional formatting with a custom formula. In the example shown, the formula used to apply conditional formatting to the range C5:C11 is:

=C5=$F$6

If the value in F6 is changed, the highlighting will update automatically.

Explanation 

Note: Excel contains many built-in "presets" for highlighting values with conditional formatting, including a preset to highlight cells that equal a specific value. However, for more flexibility, you can use your own formula, as explained in this article.

If you want to highlight cells that equal a specific value, you can use a simple formula that returns TRUE when the condition is met. For example, to highlight any cells in the range C5-C11 that contain the text "dog", you can use conditional formatting with this formula:

=C5="Dog"

In the example shown we have placed the value we are looking for in cell F6, so it can be easily changed. The conditional formatting rule itself is using this formula:

=C5=$F$6

This formula is just a simple comparison using the equal to operator (=).

When you use a formula to apply conditional formatting, the formula is evaluated relative to the active cell in the selection at the time the rule is created. In this case, the rule is evaluated for each of the 7 cells in C5:C11, and during evaluation C5 (entered as a relative reference) will change to the address of the cell being evaluated in the range where conditional formatting is applied.

The address of the cell that contains the search string (F6) is an absolute reference ($F$6) so that it is "locked" and won't change as the formula is evaluated.

Case sensitive option

By default a comparison is not case-sensitive. If you need to check case as well, you can use the EXACT function like this:

=EXACT(C5,$F$6)
Author 
Dave Bruns

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

Download 200+ Excel Shortcuts

Get over 200 Excel shortcuts for Windows and Mac in one handy PDF.