I was manually grouping the rows no need for calculations.

Ah as for logic I have multiple products, so I was going to create a data table with the product name and a value either a 1 or 0. Then use a vlookup to determine the value, and from that value determine if the group remains compressed or is expanded.