I have my data laid out per the input below and in the Excel file attached, but I'm struggling with the reporting side a little.
How can I auto-generate a P&L where each change in the 'Country' field is a separate tab, and Each change in the 'P&L', 'Line Item' and 'Detail' fields generates a subtotal calculation. To round off, a Full year column total and EBITDA calculation in the last row and column. In my example all the black numbers are data and the blue numbers are calculations.
My dummy data is structured very 'evenly' but I'd like this to work for any number of changes in those fields.
The formatting would be the cherry on top but I can explore that separately.
Many Thanks in advance!
Input:

Output:


