<p>since this is mastodon, the two classic topological sort methods are:</p><p>try running all the dependencies of a cell, recursively, with bookkeeping to avoid cycles</p><p>or start with the things with no deps, and walk backwards to any item with deps ready</p><p>the excel way has less bookeeping: slam everything into a list, calculate them one by one, and if something isn't ready, you punt it to the end of the list</p><p>and if you walk the list without any new values, then there's a cycle</p>