Forum Discussion
Historical Stock Prices into Excel from Yahoo! Finance
I am using Power Query to automatically download historical stock price data from Yahoo! Finance into Excel. The URL is https://finance.yahoo.com/quote/QQQ/history/
It populates a worksheet with a year's worth of stock prices with the following columns: Date/Open/High/Low/Close/Adj Close/Volume.
When I try to build a simple line chart using the data, the price column data is not recognized. So the Y-axis of the chart returns no values. I changed the format of the columns to "Number" but it doesn't make any difference.
Does anyone have any solutions or workarounds. I attached a copy of the spreadsheet.
Sure, just open the query on editing, find Change Type step, stay on it, select proper column and apply Decimal Number format, close the query.
I did that in attached file.
5 Replies
- SergeiBaklanDiamond Contributor
That's since all data returned is texts
= Table.TransformColumnTypes(Data2,{{"Date", type date}, {"Open", type text}, {"High", type text}, {"Low", type text}, {"Close*", type text}, {"Adj Close**", type text}, {"Volume", type text}})
Please change in Power Query on decimal numbers where applicable.
- Sam_S007Copper Contributor
Just wondering why the first column (the Date column) is recognized properly as a date column while the other 6 columns are only recognized as text? Is there any way to change the format of the price columns from text to numbers without VBA or any programming?
Thanks!
- SergeiBaklanDiamond Contributor
Sure, just open the query on editing, find Change Type step, stay on it, select proper column and apply Decimal Number format, close the query.
I did that in attached file.