excelvbaformula

Excel - Highlight rows based on set conditions


Is it possible to highlight rows where the employee Number is the same, but has more than one Job Name and at least one of those Job Names has to contain the word "Manager"? So in the case below, The employee number 12 rows would be highlighted because it has more than one Job Name and one of those Job names contains the word "Manager". Would something like this be done in VBA, Conditional Formatting, Formulas, or any other methods?


Solution

  • You can use Conditional Formatting. Assuming that your data is in cells A1:D11, highlight the whole column A, go to Conditional Formatting > New Rule > Use a formula to determine which cells to format:

    =COUNTIFS($A$2:$A$11,$A1,$D$2:$D$11,"*manager*")
    

    Hope it helps.

    enter image description here