I am pulling data from google finance to google sheet using below formula:
=GOOGLEFINANCE("NASDAQ:AAPL","price",TODAY()-10,TODAY())
and the result is like below
what i want the result to be like is below so that when i put new stock in next row result show be like below
is there any google sheet expert who can help me as i am new to google sheet and searching on internet haven't haven't me any solution.
paste this in B1:
=ARRAYFORMULA(TEXT(SEQUENCE(1, 10, TODAY()-9, 1), "dd/mm/yyyy"))
and this in B2 and drag down:
=ARRAYFORMULA(IFNA(HLOOKUP(B$1:K$1, TRANSPOSE(TEXT(
GOOGLEFINANCE("NASDAQ:"&A2, "price", TODAY()-10, TODAY()),
{"dd/mm/yyyy", "@"})), 2, 0)))
to exclude weekend you can do:
=INDEX(TRANSPOSE(QUERY(TEXT(SEQUENCE(10, 1, TODAY()-9, 1),
{"dd/mm/yyyy", "ddd"}), "where not Col2 matches 'Sat|Sun'")), 1)
however to exclude holidays it needs to be done like this:
=INDEX(TRANSPOSE(QUERY(TEXT(SEQUENCE(10, 1, TODAY()-9, 1),
{"dd/mm/yyyy", "ddd"}),
"where not Col2 matches 'Sat|Sun'
and not Col1 matches '"&TEXTJOIN("|", 1, M2:M)&"'")), 1)