If, for a particular row, each cell value always depends on

If, for a particular row, each cell value always depends on a cell that
is 3 columns to its left and 3 rows above it, is there a way to specify this
instead of hard-coding [row,col] values for each cell of the row in question?
What happens if a new row is added in between? For instance, if I have rows
A,B,C and all values in row C depend on some values in row A. Now, if a row is
added by the user such that the row order becomes A,B,X,C, how would that
relationship between A and C still be maintained?

I understand that the math features are obviously
limited and this is not supposed to be a do-all utility. I just want to get an
understanding of how much is possible and how much effort I would need to put
in (if it is even possible to accomplish my use cases).

Current math doesn’t allow
relative calculations, only absolute positioned (there is a plenty way how
order of rows/column can be changed, so it is too complex to track all of
them). Any kind of addressing translated to grid-id, cell-index - because
grid-id is constant  - adding/deleting
any new rows will not break linking between cells included in formula (changing
of row ID will split link between cells, but it have some bad side effects)