How to group by multiple columns and keep all rows

referring to your excel creates impression that the different Worksheets are looking like part results but not completely solving the case.

The best would you will share an Excel with a clear sample and description. The best would be 1 Worksheet named input, other Worksheet named output.

Also have a look here: