# Google Docs question

**URL:** <https://discussion.fool.com/t/google-docs-question/36145>\
**Category:** Saul’s Investing Discussions\
**Created:** [December 1, 2015, 2:55pm UTC](https://discussion.fool.com/t/google-docs-question/36145 "2015-12-01T14:55:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlazerMania](https://sea2.discourse-cdn.com/motleyfoolfree/user_avatar/discussion.fool.com/blazermania/32/1264_2.png) [@BlazerMania](https://discussion.fool.com/u/BlazerMania)\
**Post date:** [December 1, 2015, 2:55pm UTC](https://discussion.fool.com/t/google-docs-question/36145/1 "2015-12-01T14:55:18Z")

</div>

I apologize upfront because my question is not about a specific stock. However, it is something that will help me (and possibly others) in our stock analysis.

I am trying to create a formula in my Google Docs spreadsheet that pulls historical closing price data. For example, the closing price of SKX on June 30 (or any other date). I’ve looked everywhere and I cannot find anything that will give me this seemingly simple formula.

Does anyone know how to do this? I can get the current price no problem, but for the life of me I cannot figure out how to pull historical prices. I’ve built the formula that I thought should work based on the help and support files, but I must be doing something wrong.

Thanks!  
Fletch

---

<div class="post-metadata">

**Author:** ![CMFChadf926](https://sea2.discourse-cdn.com/motleyfoolfree/user_avatar/discussion.fool.com/cmfchadf926/32/180_2.png) [@CMFChadf926](https://discussion.fool.com/u/CMFChadf926)\
**Post date:** [December 1, 2015, 3:05pm UTC](https://discussion.fool.com/t/google-docs-question/36145/2 "2015-12-01T15:05:15Z")

</div>

Hi Fletch,

Try this.

GOOGLEFINANCE(ticker, [attribute], [start\_date], [num\_days|end\_date], [interval])

GOOGLEFINANCE(“GOOG”, “price”, DATE(2014,1,1), DATE(2014,12,31), “DAILY”)

Chad

---

<div class="post-metadata">

**Author:** ![Tamhas](https://sea2.discourse-cdn.com/motleyfoolfree/user_avatar/discussion.fool.com/tamhas/32/4672_2.png) [@Tamhas](https://discussion.fool.com/u/Tamhas)\
**Post date:** [December 1, 2015, 3:18pm UTC](https://discussion.fool.com/t/google-docs-question/36145/3 "2015-12-01T15:18:51Z")

</div>

And, if that doesn’t work, you might try [http://discussion.fool.com/spreadsheet-advice-100002.aspx?mid=32…](http://discussion.fool.com/spreadsheet-advice-100002.aspx?mid=32006695)

---

<div class="post-metadata">

**Author:** ![BlazerMania](https://sea2.discourse-cdn.com/motleyfoolfree/user_avatar/discussion.fool.com/blazermania/32/1264_2.png) [@BlazerMania](https://discussion.fool.com/u/BlazerMania)\
**Post date:** [December 1, 2015, 3:28pm UTC](https://discussion.fool.com/t/google-docs-question/36145/4 "2015-12-01T15:28:39Z")

</div>

_Hi Fletch,_

_Try this._

_GOOGLEFINANCE(ticker, [attribute], [start\_date], [num\_days|end\_date], [interval])_

_GOOGLEFINANCE(“GOOG”, “price”, DATE(2014,1,1), DATE(2014,12,31), “DAILY”)_

_Chad_

Hi Chad,

Thanks for the response. Is there anyway to just isolate one day? That gives me the price for each date of 2014. What if I just wanted 6/30/2014? What would that formula look like?

Thanks.

---

<div class="post-metadata">

**Author:** ![SageWren](https://g.foolcdn.com/misc-assets/discourse-member-avatar_120px_bronze600.png) [@SageWren](https://discussion.fool.com/u/SageWren)\
**Post date:** [December 1, 2015, 3:31pm UTC](https://discussion.fool.com/t/google-docs-question/36145/5 "2015-12-01T15:31:46Z")

</div>

Fletch,

The formula Chad gave you is on the right track, unfortunately that returns multiple cells. The trick is to index into those cells returned.

Here’s an example…

=index(GoogleFinance(A2,“price”,C$1),2,2)

In this case, cell A2 holds the ticker symbol and C1 has a date value. This was copied from a working example.

Steve

---

<div class="post-metadata">

**Author:** ![BlazerMania](https://sea2.discourse-cdn.com/motleyfoolfree/user_avatar/discussion.fool.com/blazermania/32/1264_2.png) [@BlazerMania](https://discussion.fool.com/u/BlazerMania)\
**Post date:** [December 1, 2015, 3:46pm UTC](https://discussion.fool.com/t/google-docs-question/36145/6 "2015-12-01T15:46:16Z")

</div>

Thanks Steve! That worked perfectly.

Fletch

---

<div class="post-metadata">

**Author:** ![CMFMikenpdx](https://sea2.discourse-cdn.com/motleyfoolfree/user_avatar/discussion.fool.com/cmfmikenpdx/32/3255_2.png) [@CMFMikenpdx](https://discussion.fool.com/u/CMFMikenpdx)\
**Post date:** [December 3, 2015, 2:15pm UTC](https://discussion.fool.com/t/google-docs-question/36145/7 "2015-12-03T14:15:07Z")

</div>

Steve -

Thanks. That is a much simpler formula than the one I had been using. I am going to try switching over to that one and see if it works better. The formula I had been using would occassionally return #N/A and other times work just fine. Annoying. No idea why. Does that ever happen to you with this formula?

best,  
michael

---

<div class="post-metadata">

**Author:** ![SageWren](https://g.foolcdn.com/misc-assets/discourse-member-avatar_120px_bronze600.png) [@SageWren](https://discussion.fool.com/u/SageWren)\
**Post date:** [December 3, 2015, 3:50pm UTC](https://discussion.fool.com/t/google-docs-question/36145/8 "2015-12-03T15:50:59Z")

</div>

_The formula I had been using would occasionally return #N/A and other times work just fine. Annoying. No idea why. Does that ever happen to you with this formula?_

Michael,

I can’t really say that it won’t return #N/A sometimes. My suspicion is that it will since even the current price function even does that at times. The formula I gave is not one I use in an active sheet that I watch, but one I set up once upon a time for some reason. I struggled with getting a “clean” number until I ran across the INDEX suggestion somewhere.

Steve

---

<div class="post-metadata">

**Author:** ![DolonAltekar](https://sea2.discourse-cdn.com/motleyfoolfree/user_avatar/discussion.fool.com/dolonaltekar/32/50021_2.png) [@DolonAltekar](https://discussion.fool.com/u/DolonAltekar)\
**Post date:** [December 5, 2015, 1:14am UTC](https://discussion.fool.com/t/google-docs-question/36145/9 "2015-12-05T01:14:05Z")

</div>

Try this:

=importhtml("[http://finance.yahoo.com/q/hp?s=AAPL",“table”…](http://finance.yahoo.com/q/hp?s=AAPL%22,%22table%22,17))

Here’s a URL with specific dates:

[http://finance.yahoo.com/q/hp?s=YHOO&a=11&b=1&c=…](http://finance.yahoo.com/q/hp?s=YHOO&a=11&b=1&c=2015&d=11&e=5&f=2015&g=d)

parameters:

a,b,c start date Month = 0-11, Day, Year  
d,e,f end date  
g = “d” “w” “m” “v” daily, weekly, monthly, dividends only.
