Google Sheets – Insert Row Without Losing Formulas

google sheetsgoogle-sheets-arrayformula

I am using Google sheets withe the following formula in one of the columns

=ARRAYFORMULA(IF(ISBLANK(M2), "",  ROUND(M2/G2, 2)))

Whenever I add a new row anywhere in the sheet, the formula does not get copied and I have to use other means to copy the formula in each cell of the inserted row.

How should I be writing this formula so that it automatically works for newly inserted row?

Best Answer

When using array formulas, they only know to which range they should apply calculations if you include that information. It can be confusing, since conditional formatting formulas will apply an array given just the top cell in the column range.

Try this in place of your current formula:

=ARRAYFORMULA(IF(ISBLANK(M2:M), "", ROUND(M2:M/G2:G, 2)))