Google-sheets – How to have a 2nd function start in the cell after the output of the 1st function

formulasgoogle sheetsgoogle-financegoogle-sheets-arrayformulagoogle-sheets-query

So the problem I am trying to solve is where I have Google finance fetching the price of a stock and outputting it, but the length of cells of its price history is increased by 1 each day. In the second picture where I have a yellowed area(forecasting values), this is causing an issue since the yellow cell each day gets in the way and causes the google finance cell a3 to return an error saying a327 will be overwritten.

So my question is how can I make the forecast function move down relative to the final output cell of the a3 google finance output.

enter image description here

enter image description here

Best Answer

  • delete your A column and paste this into A3 cell:

={GOOGLEFINANCE("ASX:EXL", "close", TODAY()-470, TODAY());
 QUERY(GOOGLEFINANCE("ASX:EXL", "close", TODAY()-470, TODAY()),
 "select Col1 offset "&(COUNTA(
 GOOGLEFINANCE("ASX:EXL", "close", TODAY()-470, TODAY()))/2)-1, 0)+IF(WEEKDAY(QUERY(
 GOOGLEFINANCE("ASX:EXL", "close", TODAY()-470, TODAY()),"select Col1 offset "&(COUNTA(
 GOOGLEFINANCE("ASX:EXL", "close", TODAY()-470, TODAY()))/2)-1, 0))>5,3,1),""}

0