Search code examples
google-sheetsgoogle-finance

google finance stock prices


=GOOGLEFINANCE("ABC","all",today()-30,today(),"Daily")

This returns daily stock price info for ABC for the last 30 days. Is there a way to stagger the output so it only returns every 2nd day like:

Jan 24 price
Jan 26 price
Jan 28 price

Solution

  • You can use the CHOOSEROWS function:

    =LET(data,GOOGLEFINANCE("ABC","all",today()-30,today(),Daily),
         CHOOSEROWS(data,SEQUENCE(ROWS(data)/2,1,1,2)))
    

    You could also use QUERY with the skipping clause:

    =QUERY(GOOGLEFINANCE("ABC","all",today()-30,today(),Daily),"skipping 2")