Home > Mobile >  Arrayformula in Sheets for autofilling with Trend formula
Arrayformula in Sheets for autofilling with Trend formula

Time:03-12

I have a Trend formula that takes a small horizontal array as an input and I want it to autofill a column using arrayformula. If the y and x ranges for Trend are A_:C_ and D_:F_, I can't say A2:C and D2:F because it will take in the full column as the trend array. I tried

=ARRAYFORMULA(TREND(OFFSET(A1:C1,ROW(A2:A)-1,0),OFFSET(D1:F1,ROW(A2:A)-1,0),1,False))

but the ROW(A2:A) doesn't make arrayformula reprint in each cell of the column; only the first cell fills. Is there a way to make it autopopulate despite the arguments being horizontal arrays?

view the sheet here: enter image description here

ofc if you cant say how many rows you will have or you dont want to type in 50 rows by hand you can use formula which will generate a formula like this:

={""; ARRAYFORMULA("={"&TEXTJOIN("; ", 1, "TREND(A"&
 SEQUENCE(COUNTA(A2:A), 1, ROW(A2))&":C"&SEQUENCE(COUNTA(A2:A), 1, ROW(A2))&", D"&
 SEQUENCE(COUNTA(A2:A), 1, ROW(A2))&":F"&SEQUENCE(COUNTA(A2:A), 1, ROW(A2))&", 1, 0)")&"}")}

and then you just copy-paste generated fx from bellow:

enter image description here

  • Related