This what I have so far done and get the same results as VISHAL120's formula but find that I have to run the code more than once to get the same result, hence my suspicion of circular refs. (cells in AY60:EX660 depend on cells outside that area, but some of those precedent cells in turn depend on values within AY60:EX660 - I've just got to find a chunk of time to find it/them).
Note also that cells in AY60:EX660 depend on cells within AY60:EX660 too (those in the same column above and in the same row to the left) and the order of my in-memory calculations takes account of that - perhaps Excel's on-sheet formulae calculate in a different order, but I doubt it.
A CLEAR explanation of what the relevant columns represent and what the output in AY60:EX660 is meant to represent from VISHAL120 would be helpful.