Search code examples
excelexcel-formulaconditional-formatting

Conditional format if consective cells in a column contain certain text


I'd like to do conditional formatting on column A if consecutive cells in the column contain the text "Grade". In the picture below, only A6 should be highlighted.I tried this

=AND(NOT(ISBLANK(OFFSET(A5,-1,0))),ISBLANK(A5)

but it only highlights after a cell that isn't blank. One caveat is that all the cells have a formula to determine if there is a Grade or not, so they will not really be blank.

enter image description here


Solution

  • Use a rule based on the formula =ISNUMBER(SEARCH("Grade",A1)*SEARCH("Grade",A2)), applying it to cells A2:A11.

    enter image description here