I had this problem too. I needed to build a control board using the answers incoming from a google form, The problem: when you use formulas in a column next to the sheet where the answers are submited, google inserts a new row but does not replicate the formula, so you end up copying and pasting the formula over and over again.
To solve this i used an script that copies the cell where the formula is and pastes it in all rows where the answers were.
The script is pretty simple, first you have to open the script editor in the "tools" menu, and paste the code below. You only have to "call" the sheets with a name in the code and then mark the columns where formulas are.In this case hoja1 is "BD ingresos" and hoja2 is "DB gastos"
In this case, the sheets where i have forms deploying answers are "BD ingreso" and "BD gastos", the columns where i calculate something are A, B, C, D and E in "BD ingresos" same as in "BD Gastos".
(names in spanish, sorry)
// Activar la hoja actual
var ss = SpreadsheetApp.getActiveSpreadsheet();
// se guarda hoja1
var hoja1 = ss.getSheetByName("BD ingreso");
var hoja2 = ss.getSheetByName("BD gastos")
function actualizar() {
// obtener ultima fila de la hoja
var ultimaFila = hoja1.getLastRow();
rellenarColumna("A",ultimaFila,hoja1);
rellenarColumna("B",ultimaFila,hoja1);
rellenarColumna("C",ultimaFila,hoja1);
rellenarColumna("D",ultimaFila,hoja1);
rellenarColumna("E",ultimaFila,hoja1);
// obtener ultima fila de la hoja
var ultimaFila = hoja2.getLastRow();
rellenarColumna("A",ultimaFila,hoja2);
rellenarColumna("B",ultimaFila,hoja2);
rellenarColumna("C",ultimaFila,hoja2);
rellenarColumna("D",ultimaFila,hoja2);
rellenarColumna("E",ultimaFila,hoja2);
}
function rellenarColumna(pivote, ultimaFila,hojaTrabajo)
{
//-------------------------------------------------------------
//celda que contiene la información que se va a pegar.
var celdaCopiarFormula = hojaTrabajo.getRange(pivote+"2");
//obtener valor de dicha celda
var valorCeldaCopiarFormula = celdaCopiarFormula.getFormula();
//modificar rango para que pegue la información desde la ubicacion enviada hasta la ultima fila
var rangoTotal = pivote + "2:" + pivote + ultimaFila;
//definir ubicacion en donde se va a pegar la informacion
var destinoPegado = hojaTrabajo.getRange(rangoTotal);
destinoPegado.setFormula(valorCeldaCopiarFormula);
}
Then you have to create a trigger in the script editor as this image shows. Set the trigger to launch the code "actualizar" with the event "from the spreadsheet" "on form submit"