Hi all,

I am difficulty with formatting, groupings, and subtotals.

I have a files that is all flat data and I need to take Column N (which is the type of security) and that becomes the main heading. Under that we have the industry heading which is Column D, then under that we can list the security and its values.

From there I need to just subtotal the by industry.

It is straight forward and looking at the file, (I colored coded each line to correspond to show where values comes from)
There is the prelim file tab and the end results tab. I just want the prelim file tab to look like the End Results tab.

Small caveat is that if column O says "Breakout", we show the security name, while if it says "Leave", we group all the ones that say leave together and they fall under an "Other" heading on End Results tab.

Sorry if this is confusing, but attachment should clear things up.

I have tried multiple vba snippets online, but it seems the adding the extra rows is always being tripped up.

I appreciate anyones assistance with this.

Thank you

Breakouts2.xlsx