Conditional formatting for collapsed parent rows?

I’m trying to find out if it’s possible to apply conditional formatting only when a parent row is collapsed.

Example:

If my parent row has 3 subitems and it’s currently collapsed (the subitems are hidden), I’d like to color one cell (or the entire row) in red.

But when I expand that parent row, the red color should disappear (or change to something else).

Does anyone know if there’s a workaround, formula, or trick (maybe through a control or hidden column) that could detect that state?

Thanks in advance!

1 Like