I’ve never used Coda before but from the video it looks like Coda works with blocks and not objects which makes it possible for them to be able to use formulas within a document and as a column of the table as well.
Anytype revolves around objects and objects are related to others through relations. So the best way to handle formulas is to implement them as relations but with an option to inline relations as requested here
Then, It would be possible to inline formulas inside a document to make the document dynamic. This would also keep the formulas created for a particular type to be closely coupled to that type
If formulas are getting implemented as a block rather than a relation, then it should be possible for them to be referenced in a relation so that they can be displayed as columns in a set as well or to feature a value of the formula in a page. For this, a formula has to be named and as the number of formula used by a user grows, the number of named formulas grows as well. Either ways, a relation type named Formula has to be created
One problem that is to be addressed is when dealing with Sets as sets are not a separate entity and are a container for related objects, there must be a way for users to reference the set from formulas such that the formula is limited to the elements of that set. One way to address this is to treat a set as any other objects and make it possible to create relations to a set as well. Therefore, one can create a formula relation for a set and populate it based on the set elements.
Either ways, I strongly feel that formulas should be able to access not only the relations of that object but also the relations of objects linked to that page thereby making them powerful and flexible enough for most use cases