0
votes

I am trying to run a GoogleFinance query in GOOGLE Sheets to get the stock price for the same stock. I wish to display the stock price in different rows of column A:

  1. On day 1 I will enter the formula in cell A1
  2. On day 2 I will enter the formula in cell A2

Here is the basic formula I need to use in A1 and A2:

=GOOGLEFINANCE("F", "price")

On Monday Dec 11, 2017, I entered this formula in cell A1 and it gave 12.54 in cell A1.

On Wedns. Dec 13, 2017, I entered this formula in cell A2 and it gave 12.68 in cell A2 BUT it also changed cell A1 from 12.54 to 12.68. So, now both A1 and A2 shows the same number - 12.68.

I want:

A1 = 12.54  // enter formula into this cell on Monday
A2 = 12.68  // enter formula into this cell on Wednesday

Is this possible with GOOGLEFINANCE()?

1

1 Answers

0
votes

The GOOGLEFINANCE function takes a date or range of dates:

GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])

ticker - The ticker symbol for the security to consider.

attribute - [ OPTIONAL - "price" by default ] - The attribute to fetch about ticker from Google Finance. This is required if a date is specified.

...

start_date - [ OPTIONAL ] - The start date when fetching historical data.

  • If start_date is specified but end_date|num_days is not, only the single day's data is returned.

end_date|num_days - [ OPTIONAL ] - The end date when fetching historical data, or the number of days from start_date for which to return data.

interval - [ OPTIONAL ] - The frequency of returned data; either "DAILY" or "WEEKLY".

  • interval can alternatively be specified as 1 or 7. Other numeric values are disallowed.

Examples:

GOOGLEFINANCE("GOOG", "price", DATE(2014,1,1), DATE(2014,12,31), "DAILY")
GOOGLEFINANCE("GOOG","price",TODAY()-30,TODAY())
GOOGLEFINANCE(A2,A3)

https://support.google.com/docs/answer/3093281?hl=en