Closed Thread
Results 1 to 7 of 7

Power Query to download historical stock data from Yahoo Finance

  1. #1
    Registered User
    Join Date
    06-12-2020
    Location
    Montreal, Quebec
    MS-Off Ver
    365
    Posts
    7

    Question Power Query to download historical stock data from Yahoo Finance

    Hi Everyone,

    I am using Power Query to automatically download historical stock price data from Yahoo! Finance into Excel.

    It populates a worksheet with a year's worth of stock prices with the following columns: Date/Open/High/Low/Close/Adj Close/Volume.

    The problem is the data is recognized as text only. It isn't recognized as numbers. So it's worthless. How do I covert the text into data? Preferably without any complicated programming since I'm just a basic user.

    I uploaded a copy of my workbook.

    Thanks,

    Sam
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,102

    Re: Power Query to download historical stock data from Yahoo Finance

    Use the "Text to Columns Function" under "Data" and convert text to numbers

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,803

    Re: Power Query to download historical stock data from Yahoo Finance

    In power query editor. Highlight the columns you wish to have as numbers and then right click and select change data. Select Decimal. Close and Load. In the attached you can see that I have done this for you. The volume number I changed to whole number.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    06-12-2020
    Location
    Montreal, Quebec
    MS-Off Ver
    365
    Posts
    7

    Re: Power Query to download historical stock data from Yahoo Finance

    Hi Alan,

    Thanks that worked perfectly!

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,803

    Re: Power Query to download historical stock data from Yahoo Finance

    crossposted: https://www.mrexcel.com/board/thread...nance.1137073/

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future

  6. #6
    Registered User
    Join Date
    02-11-2021
    Location
    New York, NY
    MS-Off Ver
    Microsoft 365 MSO (16.0.13628.20234) 64-bit
    Posts
    1

    Re: Power Query to download historical stock data from Yahoo Finance

    Hi Alan,

    This only pulls 3-6 months worth of data because finance.yahoo.com makes you scroll down to load the data - is there a way to get it to pull a full year, about 200-220 rows I'd estimate, from yahoo

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,803

    Re: Power Query to download historical stock data from Yahoo Finance

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Yahoo Finance API (Stock Data Download) Dead? Other Options???
    By Merf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2017, 07:11 PM
  2. Automatic Download of Yahoo Finance Data
    By mibikeks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2014, 02:19 PM
  3. Getting real time stock quotes from google finance / yahoo finance in excel
    By Navin Agrawal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2012, 12:41 PM
  4. web query and yahoo finance stock quotes
    By addingle in forum Excel General
    Replies: 2
    Last Post: 10-21-2011, 01:26 PM
  5. Download data from Yahoo Finance
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2010, 10:21 AM
  6. finance.yahoo historical data
    By tinybears in forum Excel General
    Replies: 0
    Last Post: 04-21-2006, 01:40 PM
  7. Historical Stock Quotes - Yahoo Finance
    By Jason in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2005, 08:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1