'Arrayformula in Sheets for autofilling with Trend formula
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: https://docs.google.com/spreadsheets/d/1M9DMhcc8r7ngKgjN4OuhNh1wVGocQGMz1go-LZEWquw/edit?usp=sharing
Solution 1:[1]
TREND is already arrayformula type of function so the functionality you seek is not possible. but...
it can be achieved like this by hardcoding it:
={TREND(A2:C2, D2:F2, 1, );
TREND(A3:C3, D3:F3, 1, );
TREND(A4:C4, D4:F4, 1, );
TREND(A5:C5, D5:F5, 1, )}
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:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | player0 |


