I think realistically VBA is the best route, however, if as JR states you don't want to utilise then one route would be:
Sheet2
G11: =IF(D11="","",IF(C11<>"",D11,G10&CHAR(10)&D11))
copied down for all rows
Then utilise the above column to get your results on sheet3
Sheet3
D12: =INDEX(Sheet2!$G:$G,MATCH($C12&" Total",Sheet2!$C:$C,0)-1)
copied down
(ensuring D12 onwards is set to Wrap Text)
Note: the above assumes sub totals though is meant purely as proof of concept - it can be modified as required.
Bookmarks