Search code examples
excelconditional-formatting

Highlighting multiple rows in excel based on a specific cell's text


I have a excel sheet question that I would like help on. My problem is that I am trying to highlight rows based on the specific text of "special audits" that I have listed in my column D but I would also like to highlight the multiple other rows from that same account number (column A) regardless if those rows have "special audits" in them.

Using conditional formatting does the highlighting of the rows of "special audits" but I can not figure out how to highlight the other rows from the same account. My sample sheet has 4 columns and 37 rows. Column A has numerical account numbers, Column B has the last name of the client, Column C has the date of the audit, and Column D has the type of the audit. Each client has multiple rows of audits and the account number is specific to the clients last name.

My sample excel sheet image

I thought that once I highlighted the "special audit" rows from column D then I could do another new conditional formatting rule for column A based on the cell's highlighted color. The conditional format rule that I have and works for just the one criteria that I have is =$D1="Special Audits"


Solution

  • Countifs should do it for you:

    enter image description here

    The formula used:

    =COUNTIFS($D:$D,"Special Audits",$A:$A,$A2)>0

    This basically says: Color if there's at least one cell in D-column with "Special Audits" that has the same A-column value.