ArrayFormula column disappears when sorting in a filter view in Google Sheets

I'm guessing that, because your references are normal (relative, not anchored/absolute), the range A2:A10 after sorting down turns into something absurd, like A7:A4, depending on actual sorted values.

Also, if you hover with your mouse on the #REF error, what does it tell you?

Anyway, try using absolute references in your formula:

=arrayformula({"Column 3"; A$2:A$10})

Edit Fascinating. It's the first time I see this type of error. Taking it at face value, it seems that it's a limitation of Google Spreadsheets - you cannot use ARRAYFORMULAS spanning multiple rows inside sorted filter views, because, like I sort of guessed, it messes up the ARRAYFORMULA's range (as indicated by the fact that the formula is now in C4 instead of C1).

But that gives you also the solution: do not include the cell with the arrayformula in the filter view. Instead of making your filter view's target range A1:C20, make it A1:B20. Then the arrayformula in C1 will be untouched by the filter and will indeed continue to work. enter image description here


I have found a solution for my usecase, in your case, it could be:

=arrayformula(if(row(C:C)=1;"Column 3";A:A))

But you'll need to consider the whole columns in your formulas. Example