Does this work for you ?
Test on a backup sheet first of course!
I think in reality given the almost recursive nature of the calcs you need to iterate from top to bottom ... given latter rows may appear as though they are duplicates until such time as earlier rows are removed (eg row 23)
ie you can only really determine unique nature of a given row as and when it is reached and all preceding rows have been dealt with accordingly (eg rows 21 & 22)
I suspect the above can be improved but this is more a test to see if the logic matches requirements.
Bookmarks