# How to prevent cell formulas from moving down when data comes in from 3rd party app

So I need to create a quiz with AidaForm, and link the results of this quiz with Google Sheets. There is some additive calculation involved, so in the Google Sheets document I would type in the formula first in a cell (C2) like this:

A B C
1 Question 1 Question 2 Score
2 =A2+B2

The issue is that whenever AidaForm updates Google Sheets with the user input, the pre-set formula would shift down an entire row and hence not calculate the user's quiz results:

A B C
1 Question 1 Question 2 Score
2 5 6
3 =A3+B3

Is there any way to make the formula stay in its row and not shift down when data is added to Google Sheets from AidaForm?

P.s. AidaForm does not allow me to configure any settings relating to the appending of form data to Google Sheets.

## 2 Answers

Google Forms, and many other form processing programs, insert form responses in newly created rows that cannot be referenced directly in advance. The usual recipe to work around the issue is to use an array formula that processes a whole column in one go, instead of processing one cell at a time.

The solution by @Boris will work, provided that you clear column `C` before inserting the formula to cell `C1`. Alternatively, use this formula to avoid superfluous zeros in blank rows:

`=arrayformula( { "Score"; iferror( 1 / (A2:A + B2:B) ^ -1 ) } )`

Put the formula in the topmost cell of a free column.

C1: `={"Score"; ARRAYFORMULA(A2:A + B2:B)}`

The OPs question is: "Is there any way to make the formula stay in its row and not shift down when data is added." The solution I proposed answers this question.

Curly braces define a vertical array of 2 elements: = {"Text"; formula}.

The first element "Text" is static and is located in the 1st cell of the array. It keeps the column header unchanged when adding data.

The second element formula includes the arrayformula()

PS. I marked @ doubleunary's answer as helpful, as it, in addition to answering the OPs question, answers an unasked question - a check for nulls and uses a great approach for that.