How can I do this one excel?

So essentially what i want to do...i get a correlation analysis of 20 different stocks / industries to each other..with the daily prices for the past 10 years.....whats the best software / or method of doing this?....can this be done on excel? or is reuters or another software better for this? ...also...whats a good database to get the stock prices in a nice downloadable excel file?....and if i am using excel...is there anyway to build a macro that automates the process of having to manually do a correlation for each two rows of data prices for the past 10 years?.....any feedback is greatly appreciated..thanks

6 Comments
 

In excel, put the data into columns. If you haven't already, install Data Analysis for Excel. Go to Tools -> Data Analysis. Select Correlation and go from there.

Jack: They’re all former investment bankers who were laid off from that economic crisis that Nancy Pelosi caused. They have zero real world skills, but God they work hard. -30 Rock
 

If you have a bloomberg terminal this is actually pretty easy to do and would not be that time consuming at all.

Alternatively you can pull data from yahoo finance.

I really want to learn VBA/Macros as I often find myself needing to do a lot of goofy stuff in excel but end up taking a bunch of uncessary steps that i wouldnt otherwise need to w/o excel. I suck with programming in general so its been something i have wanted to learn just never got around to it.

"Oh the ladies ever tell you that you look like a fucking optical illusion" - Frank Slaughtery 25th Hour.

"Oh the ladies ever tell you that you look like a fucking optical illusion" - Frank Slaughtery 25th Hour.
 
Best Response

VBA is your friend. The code for 1-2 requires a bit more, well, code, but here's some pseudo-code for step 3:

1 - pull data sets from yahoo finance (search for ichart.finance.yahoo.com and csv for more info on this) using web queries 2 - dump it on a worksheet, one column/stock 3 - Run your correlation analysis, whatever it is (p-test, r^2, correl, etc.) through a nested for loop

Code-sort of for #3, assuming that each column in row 1 has a header: Dim i, j as Integer Const statFormula as String = "=CORREL(range_x, range_y)" 'change me For i = 1 to ActiveSheet.Range("A1").End(xlToRight).Column - 1 For j = i + 1 to ActiveSheet.Range("A1").End(xlToRight).Column ActiveSheet.Cells(1,i).End(xlDown).Offset(2(j - i),0).Value = ActiveSheet.Cells(1,i).Value & "-" & ActiveSheet.Cells(1,j).Value ActiveSheet.Cells(1,i).End(xlDown).Offset(2(j - i) + 1, 0).Formula = Replace(Replace(statFormula, "range_x", Range(ActiveSheet.Cells(2,i), ActiveSheet.Cells(2,i).End(xlDown)).AddressLocal(False,False)), "range_y", Range(ActiveSheet.Cells(2,j), ActiveSheet.Cells(2,j).End(xlDown)).AddressLocal(False,False)) Next Next

Feel free to PM me with questions on the code / VBA in general

 

oh man the things i could do if I knew how to code like that. Wanna help me backtest some trading strategies and develop the black box? lol.

"Oh the ladies ever tell you that you look like a fucking optical illusion" - Frank Slaughtery 25th Hour.

"Oh the ladies ever tell you that you look like a fucking optical illusion" - Frank Slaughtery 25th Hour.
 
trade4sizeoh man the things i could do if I knew how to code like that. Wanna help me backtest some trading strategies and develop the black box? lol.

lol, that's pretty much what I've been doing for the last ~4 months at work...

 

Id maiores laboriosam consectetur magni labore. Placeat ipsam quod occaecati voluptatum. Quia et doloremque doloribus qui ex. Eveniet ut ut repellendus nulla. Dignissimos rerum pariatur ad delectus commodi mollitia officiis.

Ducimus voluptatem reiciendis quis quibusdam et et. Saepe corporis dolor explicabo rerum. Voluptas repellat quod aut numquam. Adipisci aliquid qui cumque expedita aperiam occaecati laboriosam architecto. Reprehenderit vitae minus et facilis modi. Pariatur omnis aspernatur modi qui dolore vel. Quaerat et placeat quae magni asperiores.

Sunt ea beatae suscipit natus. Aspernatur rerum quas dolore aliquid. Aspernatur ullam occaecati libero soluta quidem repudiandae. Praesentium ea fuga placeat impedit.

Jack: They’re all former investment bankers who were laid off from that economic crisis that Nancy Pelosi caused. They have zero real world skills, but God they work hard. -30 Rock

Career Advancement Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.8%
  • JPMorgan 01 98.2%
  • Guggenheim Partners 01 97.7%
  • Morgan Stanley 07 97.1%

Overall Employee Satisfaction

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Morgan Stanley 01 98.8%
  • Evercore 01 98.2%
  • BMO Capital Markets 12 97.6%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Evercore No 98.8%
  • Morgan Stanley 05 98.2%
  • JPMorgan No 97.7%
  • BMO Capital Markets 12 97.1%

Total Avg Compensation

June 2026 Investment Banking

  • Vice President (14) $434
  • Associates (43) $259
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (75) $151
  • Intern/Summer Analyst (65) $101
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
Secyh62's picture
Secyh62
99.0
3
BankonBanking's picture
BankonBanking
99.0
4
kanon's picture
kanon
99.0
5
dosk17's picture
dosk17
98.9
6
GameTheory's picture
GameTheory
98.9
7
DrApeman's picture
DrApeman
98.9
8
Betsy Massar's picture
Betsy Massar
98.9
9
CompBanker's picture
CompBanker
98.9
10
Jamoldo's picture
Jamoldo
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”