I'm trying to conditionally format a total row to turn or not turn a color based on the individual rows that make up that sum. I've attached a sample to go along with my explanation.

My sheet is broke into 4 units with a total at the top. Each unit has a color that helps identify it. I would like for the total line to turn the color of the unit that makes up it's total only if that is the only unit part of the total otherwise I would like for it to stay non colored indicating that there are multiple units involved. It seems fairly easy to me how to get the total row to turn a color if a units row is greater than 0, but my mind block comes when I think of combining those with some kind of conditional formatting formula/step that leaves the cell non colored if there is no total or the total is made up of more than one unit.

Conditional formatting example.xlsx