Search code examples
dateif-statementgoogle-sheetsgoogle-sheets-formulaarray-formulas

Set column default value in Google Sheets


I have a finance tracking worksheet that has a number of formulas for each row. What I'd like to add is have these formulas replicate whenever a new row is inserted (fill it with a "default value").

Sheet before adding the row:

Before Adding Row

Sheet after adding the row:

After adding row

I'd like some of these cells (B28 in this case) to contain a formula. for this row the formula is:

=IF(ISBLANK(C27), "", CONCATENATE(YEAR(C27), "-", MONTH(C27)))

Solution

  • You might want to consider an ArrayFormula. Here's a place for getting detail. In your case, the big trick is knowing that you can run the formula through all of Column C using the notation something like C1:C. Doing it this way is far more self documenting than burying it in a Google function and it's way more general.