I have a sheet titled 'Raw_Data' that I insert data into every day by inserting new rows above the data from the last day. I have another sheet titled 'Overall_Formulas' that populates formulas based on the data that is in the 'Raw Data' sheet. Right now there are arrayformulas that populate all the cells in "Overall_Formulas" when "Raw_Data" is updated. However, I am trying to get away from that so that I can go back and edit specific cells in "Overall_Formulas" individually. -- You can't do that with arrayformulas.
What I'm trying to accomplish is when I add new rows of data to 'Raw_Data', a custom script runs and inserts the same amount of new rows into the 'Overall_Formulas' sheet with the specific formulas I have for each cell.
For example: Let's say I inserted 2 new rows (starting on the 2nd row) into "Raw_Data" and then filled those 2 new rows with the data I have. From there, 2 new rows would also be inserted (via onEdit script) into the top of the sheet "Overall_Formulas" with columns A2:S3 filled with specific formulas for each cell. Each cell in "Overall_Formulas" would then be the following :
("A2").setFormula('=timevalue(text(F2, "hh:mm:ss")'); ("A3").setFormula('=timevalue(text(F3, "hh:mm:ss")'); ("B2").setFormula('=timevalue(text(F2, "hh:mm:ss")'); ("B3").setFormula('=timevalue(text(F3, "hh:mm:ss")'); ("C2").setFormula('=(text(D2, "dddd")'); ("C3").setFormula('=(text(D3, "dddd")'); ("D2").setFormula('= text(F2, "mm/dd/yyyy")'); ("D3").setFormula('= text(F3, "mm/dd/yyyy")'); ("E2").setFormula('=text(F2, "MMMM")'); ("E3").setFormula('=text(F3, "MMMM")'); ("F2").setFormula('=Raw_Data!A2'); ("F3").setFormula('=Raw_Data!A3'); ("G2").setFormula('=Raw_Data!C2'); ("G3").setFormula('=Raw_Data!C3'); ("H2").setFormula('=Raw_Data!L2'); ("H3").setFormula('=Raw_Data!L3'); ("I2").setFormula('=Raw_Data!W2'); ("I3").setFormula('=Raw_Data!W3'); ("J2").setFormula('=K2/H2'); ("J3").setFormula('=K3/H3'); ("K2").setFormula('=IF($G2="withdrawal", ($M2-$P2)-$H2, ($H2-($L2+$P2)))'); ("K3").setFormula('=IF($G3="withdrawal", ($M3-$P3)-$H3, ($H3-($L3+$P3)))'); ("L2").setFormula('=if(Raw_Data!$AC2=0, "UNKNOWN", Raw_Data!AB2-Raw_Data!AC2)'); ("L3").setFormula('=if(Raw_Data!$AC3=0, "UNKNOWN", Raw_Data!AB3-Raw_Data!AC3)'); ("M2").setFormula('=Raw_Data!M2*Raw_Data!O2'); ("M3").setFormula('=Raw_Data!M3*Raw_Data!O3'); ("N2").setFormula('=(If($G2="withdrawal", 0, $L2-$M2)'); ("N3").setFormula('=(If($G3="withdrawal", 0, $L3-$M3)'); ("O2").setFormula('=$N2/$M2'); ("O3").setFormula('=$N3/$M3'); ("P2").setFormula('=Raw_Data!Q2*Raw_Data!AE2'); ("P3").setFormula('=Raw_Data!Q3*Raw_Data!AE3'); ("Q2").setFormula('=$P2/$H2'); ("Q3").setFormula('=$P3/$H3'); ("R2").setFormula('=Raw_Data!E2'); ("R3").setFormula('=Raw_Data!E3'); ("S2").setFormula('=Raw_Data!F2'); ("S3").setFormula('=Raw_Data!F3');