The highlighting is done automatically with a conditional formatting rule applied to the range B4:G12.

The rule bang out is “Use a formula to determine which cells to format”.

Each cell in B4:G12 is evaluated separately.

Excel formula: Highlight cells that contain

Since B4 is entered as arelative reference, it will change to the cell being evaluated.

Since cell G2 is entered as anabsolute reference($G$2), it will not change.

The formula uses theSEARCH functionto match cells that begin with “mi”.

Excel formula: Highlight cells that end with

SEARCH returns a number that indicates a position when the text is found, and a #VALUE!

error if the text is not found.

The formula returns TRUE when the position is 1 and FALSE for any other value.

Excel COUNTIF function

The value in cell G2 can be changed at any time and the conditional formatting will instantly update.

However, FIND is automatically case-sensitive.

When the text is not found, FIND returns a #VALUE error.

Excel FIND function

Article image

Article image

Article image

Article image