I am trying to build an advanced subtotal formula which will subtotal based on criteria. The background is that I have an income statement that I am building with different "levels", meaning that level 1 provides high level information and the lowest level (named "New GL") will have the lowest level of detail. "New GL" is effectively a consolidation of line items "Old GL". Each line item on my income statement has a level allocated to it, and so I need to build the formula such that the higher level will subtotal its direct lower level, and here is the complexity, until it finds the next level of its own type.
For example, level 3 needs to subtotal all level 2 line items below it until the next level 3 line item. It is easy to do this if one manually runs a simple sumif/ subtotal formula, however I can't figure out how to create a generic formula which does not need manipulation for each level and line item it is subtotalling, and which caters for the bold text above. Note that levels 1, 2, 3, 4, and "New GL" (which can also be called level 5) need the formula.
I've attached a spreadsheet........hope my query has come across clearly.
Thanks
For example, level 3 needs to subtotal all level 2 line items below it until the next level 3 line item. It is easy to do this if one manually runs a simple sumif/ subtotal formula, however I can't figure out how to create a generic formula which does not need manipulation for each level and line item it is subtotalling, and which caters for the bold text above. Note that levels 1, 2, 3, 4, and "New GL" (which can also be called level 5) need the formula.
I've attached a spreadsheet........hope my query has come across clearly.
Thanks