SOLVED

Historical Stock Prices into Excel from Yahoo! Finance

Copper Contributor

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.

5 Replies

@Sam_S007 

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.

@Sergei Baklan 

 

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!

best response confirmed by Sam_S007 (Copper Contributor)
Solution

@Sam_S007 

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.

@Sergei Baklan 

 

Hi Sergei,

 

Thanks! That works perfectly. 

 

Sam

 

1 best response

Accepted Solutions
best response confirmed by Sam_S007 (Copper Contributor)
Solution

@Sam_S007 

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.

View solution in original post