Need help with a Google sheets formula.
=AVERAGE(OFFSET(GV2,3,-5,1,5))
Gives me the answer I want, (an average of the last five days closing price on my stock), but the cell GV2/closing price is dynamic, so that is the cell with the right information for today but it will not be the correct cell for tomorrow... So instead of having to change my formula every day to reflect the correct cell/number, I want to replace the GV2 in the formula with a cell that is always TODAY.
=XMATCH(TODAY(),2:2,0)
Gives the cell that is TODAY()
The problem: When I paste XMATCH(TODAY(),2:2,0) overtop where the GV2 is in the first formula, it does not work. It is probably something simple like I need another parenthesis somewhere, but I can not figure out how to nest these two formulas.
Right now, this is what I have
=AVERAGE(OFFSET(XMATCH(TODAY(),2:2,0),3,-5,1,5))
error message says: The argument must be a range
Any help from my brainy friends would be greatly appreciated.
=AVERAGE(OFFSET(GV2,3,-5,1,5))
Gives me the answer I want, (an average of the last five days closing price on my stock), but the cell GV2/closing price is dynamic, so that is the cell with the right information for today but it will not be the correct cell for tomorrow... So instead of having to change my formula every day to reflect the correct cell/number, I want to replace the GV2 in the formula with a cell that is always TODAY.
=XMATCH(TODAY(),2:2,0)
Gives the cell that is TODAY()
The problem: When I paste XMATCH(TODAY(),2:2,0) overtop where the GV2 is in the first formula, it does not work. It is probably something simple like I need another parenthesis somewhere, but I can not figure out how to nest these two formulas.
Right now, this is what I have
=AVERAGE(OFFSET(XMATCH(TODAY(),2:2,0),3,-5,1,5))
error message says: The argument must be a range
Any help from my brainy friends would be greatly appreciated.
Last edited by a moderator: