0
votes

The answer is next:

1) There is formula in Google Sheet cell "A11", for example "=F11+C11";

2) I append multiple data to this Google Sheet list with the help of https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate or https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append

3) I need to append the value for "A12" using its current position. It had to become "=F12+C12".

Or if I append data on top (as described here - Google sheets API append method (last on top)) I need that formulas under my append changed to correct value. If current value of "A11" is "=F11+C11" then, if I add 3 rows before this row, it becomes "A14" cell and it's value had to be changed to "=F14+C14"

Is there any way to realise both this scenarious directly in Google Sheets API request? May be there is some settings in Google Sheet that can help me (something like formating of cells/columns etc)?

UPD. For now it all works fine except of that incident when formula returns exception! My questions is not actual for now, but I still not understand in which cases formulas will change and in which they will not.

1

1 Answers

0
votes

The answer is quiet simple!

I update cell 'A13' with formula '=B2+C2' and as cells 'B2' and 'C2' stay on their places after every changes my cell 'A13' still link cells 'B2' and 'C2'.

But if I will add row before 'B2' and/or 'C2' then formula will change and my cell 'A13' will link 'B3' and 'C3'.