Search code examples
google-sheets

Add formula to entire row of google sheets


I am using a google sheet as a database. When a row is populated (using JSON API and Integromat), I want formulas in the newly added row to update. However, I cannot get the formula to be applied to the whole column automatically.

For instance, C1 is =A1+B1. When A2 and B2 are added, C2 should be =A2+B2.

I have tried:

  • Double clicking the box in the bottom right corner of the selected cell. This does not work because it adds the formula for all rows that contain data. When a new row is added, the formula is not applied to that row.
  • Using the formula with a range =A1:A+B1:B. This formula is only applied to the selected cell.
  • Pasting the formula in the column header. This simply did not work. Even when I tried to include a formula that used a range =A1:A+B1:B.
  • Using hotkeys like shift + ctrl + Down + D. I was unable to find any that worked. Most were for windows computers (I am using a mac).

I'm sure I'm just making a stupid error, but I haven't been able to find any solutions.

Thanks in advance!


Solution

  • Place this in the header row (assuming the header row and you want to add all other rows).

    ={"YOUR HEADER";ARRAYFORMULA(A2:A+B2:B)}