0 ratings0% found this document useful (0 votes) 88 views7 pagesGet Current and Historical Stock Prices Into Excel
Current, Historical, Stock Prices, Excel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Drawing for Matrix script signed by Keanu Reeves. $B [Link] &
Learn More ([Link] _([Link] Ya
drawing) ([Link]
EXCEL FREE GIFT (/free-gift)
UNIVERSITY
(HOPE //[Link]/)
Get Current and Historical Stock Prices
into Excel
Jeff Lenning ([Link] | July 15,2019 | Comments Off
Microsoft recently updated the built-in tools for retrieving stock quotes into Excel. If you're typing closing
prices into Excel manually, this article may be able to help you get it done faster. Specifically, we'll talk about
how the Stock data type retrieves current quotes and related information, and how Power Query can retrieve
historical stock quotes from the web, Welll take them one at a time.
Note: This article is presented with Excel 0365 for Windows; not all versions of Excel include the features
discussed.
Current Prices with the Stock Data Type
Let's say you have a handful of tickers and you want to view their current prices or related information.
Perhaps your list is stored in a table (Insert > Table) and looks like Figure 1Drasepateagtey ix script signed by Keanu Reeves. $B thtps://[Link]/)
Lear \s://[Link]/matrix- _([Link]
([Link]
dra\
iewcart)
GOOG
Re FREE GIFT (/free-gift) =
UNIVERSITY —
BE//[Link]/)
(Note: converting your ticker list into a Table isn't required, it just makes this feature easier to use)
You can select the tickers, then click the Data > Stocks command in the Data Types group. When you do, Excel
attempts to convert those static text values into stocks (Figure 2).
a
Hi Microsoft Corp (KNAS:MSFT)
Alphabet Inc (XNAS:GOOG)
Apple Inc (KNAS:AAPL)
The little icons indicate Excel has successfully found the ticker symbols and converted them into stocks. So,
what is so special about the stock data type? It retrieves a rich collection of market data—including current
price, volume, high, low, company name, company description, number of employees and much more. To
reveal these additional attributes, just click the little stock icon to the left of the company name and youll see
a pop-up card that contains related data. Or, if you want to view the related data in cells, just click the little
‘Add Data icon in the upper right. For example, we can select price, high and low from the list and Excel
retrieves the corresponding values (Figure 3).
ao ice - a ee -
Hi Microsoft Corp (KNAS:MSFT) $ 127.16 $ 128.00 $ 126.73
fim Alphabet Inc (XNAS:GOOG) $ 114190 $1,151.57 § 1,133.51
HBApple Inc (KNAS:AAPL) $ 17905 § 18057 § 177.91
You can manually refresh the values any time by right-clicking any of the stock icons and selecting Data Type
> Refresh. If you had previously used the MSN Money Central Investor Stock Quotes connection, this is the
replacement feature and provides much more information.
But what if you want to retrieve historical quotes? For that, we can import data from a
corresponding web page with Power Query.
Historical Prices with Power Query
At the time of this article, the Stocks data type contains current quotes only, So, if we want historical quotes,
welll need to turn to the web. Pull up your favorite historical quotes web page or do a web search. In this
article, we retrieve historical quotes from [Link].
The Yahoo service works well with Power Query and has a logical URL structure that is easy to customize for
your desired ticker symbol. It uses the format:
https: //#inance. yahoo. con/quote/YOUR-TICKERHERE/history/
Since Microsoft's ticker is MSFT, we could type the following URL into any web browser to see the historical
quotes:
+ [Link]Drala Po Flat tk Ser BUEIGRELEH Hee PREEVEENE IC nto agMbiheaWeAtdiclRRARRWerenmMeliife Byeble
Led ba WaiRplor NRE TREF GARR AIENCURWRIRASE JotaneeselAear pn Shs Yur ARREARS BAR Ab gH FOU
[Link] range on the web page, copy (Ctrl+C) the infous REG: ARES ACRE RUMIEF RRP EGNAS Re PCASH-Mewcart)
Paste Special
EXEL the webpage formatting, this may or may MBER GkAMdifTeR B89, this uiclgggpy/paste
BE//[Link]/)
‘Another option is to download a file from that webpage (if available) and then open it with Excel. This option
typically avoids the formatting issues that can occur with copy/paste. In the case of the Yahoo page, there is a
Download Data link that exports a CSV file that can be opened with Excel. And, if this was a one-time project,
this option may be sufficient.
But, if this was something we needed to update on an ongoing basis, another option is to use Power Query.
Going forward, rather than browse to the webpage to view and download or copy the data, we can just click
Refresh from within Excel. To do so, click Data > From Web in the Get & Transform group (not the legacy Get
External Data group). This will open Power Query's From Web dialog. You simply paste or type your desired
URL (Figure 4).
x
From Web
@ Basic Advanced
aL
httosi//[Link]/quote/MSFT/history/
OK Cancel
This will display Power Query's Navigator dialog where you're provided a list of importable items, which are
essentially various tables that appear on the web page. We click through the list of tables until we see the one
we want to import. For example, in our case, Table 2 holds the historical quotes (Figure 5).
a x
Navigator
2 | [BEN Wen view
Select multiple tems Table 2 i
Display Options ~ 2
ae & Date (Open High tow
A fp finance yahoo com quote MSF ‘sha/ieie 2598 12309
A
Document sfoa2019 12531 ura
tbo 232019 2520 12529
S/a2/19 126.2 12524
Tablet »
speyneis 2783 2752
( Table2 5/20/2019 125: 12759 v
FA Table 3 (5/37/2019 128.31 130.45
< >
tox |*| [ tansermoas | [ ca
With the desired table selected, we just click the down arrow on the Load button and select Load To, In the
resulting dialog, we select Table and ... the results are loaded into the specified worksheet (Figure 6)[Link]/)
[Link]/login/)
sdbaps://[Link]/cart?action=viewcart)
126.18
LD7FREE GIFT (/free-gift)
126.90
5/23/2019 126.20
5/17/2019 128.31
Now, the nice thing about using Power Query is that next time we need to retrieve updated historical quotes,
we can simply right-click any cell in the results table and select Refresh, Power Query essentially retrieves
updated values from the original URL. In Excel, we see the updated table rows.
hope these methods provide an efficient way to retrieve current and historical stock quotes into your Excel
file. And remember, Excel rules!
Posted in
+ Power and Pivot ([Link]
Make Quick Work with 10 Excel Skills — ([Link]
with-10-excel-skills/)
les Jeff Lenning
Love sharing the things I've learned about Excel, and | built Excel University to
help me do that. My motto is: Learn Excel. Work Faster.
Excel is not what it used to be.
You need the Excel Proficiency Roadmap now.
Includes 6 steps for a successful journey, 3 things to.
avoid, and weekly Excel tips.
Free Roadmap ([Link]
[Link]/roadmap/)Drawing for Matrix script signed by Keanu Reeves. BB tnttps://[Link]/)
%"_([Link]
eal
Learn More ([Link]
drawing). .[Link]/cart?action=viewcart)
EXCEL
UNIVERSITY
[Link]/)
Excel University Books (/book)
available at
amazon
—
acne
Excel University Volume 1
([Link]Drawing for Matrix script signed by Keanu Ree\ = ps://[Link]/)
Learn More ([Link] atric (hl [Link]/) WY
drawing). [Link]/cart?action=viewcart)
EXCEL © (free-git) =
UNIVERSITY =
//[Link]/) hig ae ati
Excel University Volume 2
([Link]
eas
pay wii
Excel University Volume 3
([Link]
cong
4
o
pore ees
Excel University Volume 4
([Link]
About Connect
About Us (/university-preview/) Linkedin (hteps://[Link]/in/jefflenning/)
Docs ([Link] YouTube
Thttne/hansay uruitiihe ramir/ayreliinivereitvinc)DAHA dr MAHARSEAER Sn ed by Keanu Reeves.
‘Feat inca [Link]/matrix-
drawing).
Scholarship (/scholarship)
tEMEEbonsor)
UNIVER:
(nop Nea Daas) com/)
Privacy Policy (/privacy-policy/)
Training
Course List ([Link]
Student Login ([Link]
[Link]/my/)
For CPAs (/courses)
For Individuals (/campus-pass)
For Groups (/online-group-excel-training)
For College Professors (/excel-content-for-accounting-
information-systems-or-other-college-course/)
Speed Loop (/speedloop)
Contact
Contact Form (/contact)
+1 (949) 200-7688 ([Link]
support@[Link]
Excel University
307 E Willow St #3, Harrisburg, SD 57032
$B thitps://[Link]/)
([Link]
([Link]/cart?action=viewcart)
(hpsi/win facebook com/exceluniverstyin)
FREE GIFT (/free-gift) _
Instagram =
([Link]
Twitter ([Link]
Blog (/blog)
Related
Excel Forum ([Link]
Excel Jobs ([Link]
Excel Consulting ([Link]
[Link]/consultants/)
Excel Books (/book)
Excel Coaching (/coaching)
Free Resources (/learn-excel-free)
Excel University ([Link] | Copyright © 2012-2020 | All rights reserved