Search code examples
google-sheetsgoogle-sheets-formula

Google sheets to get stock data on a specific date


I am tying to get google sheets to produce stock quote on a given date. To do this I am using this code =GOOGLEFINANCE("AAPL", "close", DATE(2023, 5, 20)) for example, but this is producing this error:

Error
When evaluating GOOGLEFINANCE, the query for the symbol: 'AAPL' returned no data.

Could you please advise how this error can be resolved?


Solution

  • GOOGLEFINANCE() is pulling data from https://www.google.com/finance. If you check the data of 'AAPL' in this link: https://www.google.com/finance/quote/AAPL:NASDAQ, you can see that there is no posted data for MAY 20-21, 2023. enter image description here

    I have tried your formula and it is now displaying data without error but it is showing the latest data available as of the moment. (May 22, 2023) enter image description here

    Data from 5-15-2023 to 5-23-2023 enter image description here