From what I best understand your question, I suggest a solution based on a Helper column. A solution without Helper column might also be possible.
In this example sample data is in Cells D2:J13, D being the header row.
At the end of your data, create a Helper Column and put the following Formula in K3 and press CTRL + SHIFT + ENTER from within the formula bar to create an Array Formula. The Formula shall now be enclosed in curly braces to indicate that it's an Array Formula. All it does it checks for CP within a group and if found marks all Cells of that group in Helper Column as 1 else 0.
=IF(SUM(IF(IF($D$3:$D$13=D3,$F$3:$F$13,$D$1)="CP",1,0))>0,1,0)
In above formula there's a constant reference of D1 which is a blank cell somewhere outside of the data.
Select Cell D3, go to Conditional Formatting. Select New Rule, Use a Formula to determine which cells to format.
Put the formula =$K3=1 and select the background fill color of your choice.
Now use the Format Painter and apply the conditional formatting to all of your applicable cells.

