Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
Should you bother picking stocks? A simple Excel Spreadsheet

By thefirelane in Technology
Wed Mar 29, 2006 at 02:15:58 AM EST
Tags: You Know... (all tags)
You Know...

When investing in the stock market, tracking one's returns accurately is the most important thing no one does.

This article will show how regular investors can track their returns against the S&P 500 index. Any other index could be used.

The instructions in this article give the steps necessary to create an excel spreadsheet that will show two things: the total return on investment of all stock transactions, and the hypothetical return of those same transactions if the funds were instead invested in an exchange traded index fund (in this case, SPY).

Many investors are not aware of what this delta is, and therefore they have no method to measure themselves as a stock picker. It could very well be that they are wasting their time and money when they could simply invest in an index fund and achieve greater performance.


Step 1: adding all transactions

This is the most tedious part, but it is essential to capture all transactions in order to get an accurate picture.
Create an Excel spreadsheet with a row containing the following values as headings:

  • Ticker
  • Date Purchased
  • Date Sold
  • Shares Bought
  • Purchase Price
  • Current, or Sold Price
  • Amount Invested
  • Percent Change
  • Dollar Change
  • S&P Change
  • S&P Dollar Change
  • Difference
For convenience, I have already created an example spreadsheet
Now you must manually type in the following information from your records for each stock:
  • Ticker
  • Date Purchased
  • Shares Bought
  • Purchase Price
Note: some stocks, if purchased at different dates will have this information across more than one row: such as this

If you have sold the stock, add the following information manually: Date Sold, Sold Price. In the example spreadsheet, I've added a couple stocks, two of which are currently held: PTR, EBAY and one which was sold: ARMHY.

If you have not sold the stock, ignore the current price cells for now.

Note: currently purchase price has to be adjusted for any stock splits by dividing it (see eBay in example spreadsheet)

Step 2: Automatic formulas

Next we add the formulas that are automatic across all transactions. In the columns listed, enter the formulas given. Apply these formulas across all rows by clicking the lower right corner of that cell and dragging it down.

  • Amount Invested: =D2*E2
  • Percent Change: =((F2/E2)*100)-100
  • Dollar Change: =(G2*((H2+100)/100))-G2
  • S&P Dollar Change: =(G2*((J2+100)/100))-G2
  • Difference: =K2-I2
Your spreadsheet should now look like this

Step 3: Adding the S&P 500

First, go to this page. In the form, enter the date of your first stock purchase. This date is needed in order to compare the returns between your investments and if you had made that same investment in the S&P 500. Make the end date today's date. Click on 'download to spreadsheet'. Open this .csv file in excel and select all the columns. Copy and paste this information into a new worksheet in your current excel file.
Your spreadsheet should now look like this

Step 4: Vlookup(), your friend

Now, we can compute the S&P 500 change value (for now, just the sold stocks). To do this, we use the VLOOKUP function. VLOOKUP searches for a value in the leftmost column of a table and then returns a value in the same row, in a specified column. Basically, we will use this to look up the value of the S&P 500 at the date we bought (and sold) a stock. For your sold stocks, set this column to the following formula (adjusting for row):
=((VLOOKUP(C2,SP500!A:G,7,)/VLOOKUP(B2,SP500!A:G,7,))*100)-100
This formula takes the values in Date Purchased, and Date sold, and then scans through the S&P 500 historical prices until it finds those dates. When it finds those dates, it returns the adjusted close, which accounts for any dividends and stock splits.

Step 5: getting the current prices

Now you must run a web query. You will want to run a saved query.

Windows: Open, ProgramFiles/MicrosoftOffice/Office11/Queries/MSN MoneyCentral Investor Stock Quotes.iqy

Mac:Insert a new worksheet, and call it 'portfolio'. This worksheet is where you want to add your web query. Go to: Data, Get External Data, Run Saved Query... MSN MoneyCentral Investor Stock Quotes

Now add the stock tickers that you have not yet sold. Be sure to also include SPY! Click 'use this value for future refreshes'.

For windows users this will open a new spreadsheet. Rightclick the worksheet name, and move it to the current spreadsheet you are working on. Mac users should have the portfolio opened into their new worksheet.

You will now have a nice portfolio in an excel spreadsheet. This can be updated with current prices by going to: Data:Refresh Data

In the transactions worksheet, for stocks which were not sold, set their value (column F) equal to the current price in the MSN money download chart.
Example formula: ='MSN Money Central Stock'!D4
Under the column 'S&P change' use Vlookup as described in step 4 to compute the percentage change between the purchase price, and recent price of the S&P500 in the web query
Example: =(('MSN MoneyCentral Investor stock'!D6/VLOOKUP(B2,SP500!A:G,7,))*100)-100

Almost done

Now the column 'Difference' accurately reflects the difference between your actual transaction, and what you would have made if you put the equivalent amount of money in SPY. In this case negative numbers are good As it means you would less money if you invested in the S&P500 index.
As a final touch, insert one more row under each stock that has paid a dividend. In the example file, I included a 100 dollar dividend from PTR. This value must be added as a negative in order for the math to work

Reporting the final result

Create a new worksheet. with the following text in column A

  • Total Amount invested
  • Total Gain
  • % Gain
  • S&P500 Gain
  • S&P 500 % Gain
  • If I invested in S&P 500
In column B, they should have the corresponding formulas:
  • =SUM('all transactions'!G:G)
  • =SUM('all transactions'!I:I)
  • =B2/B1*100
  • =SUM('all transactions'K:K)
  • =B4/B1*100
  • =SUM('all transactions'L:L)
Again, for the final value, negative numbers are better. It means you picked things better than simply investing in the S&P 500 index fund. Sadly, for most people who read this, this number will be positive.

Closing thoughts

There are still a couple inconvenient things that must be done with this excel spreadsheet. For instance, everytime a stock is sold, the S&P500 historical data must either be re-downloaded, or entered by hand. Since most invdividuals interested in this tracking tool are long term investors, this should not be too frequent.

In addition, all the final difference number does not include several important considerations:
You must consider the comisison for trading an ETF. For this chart, commission is not accounted for, as it would be equal for both transactions. However a comparison between trading stocks versus an index mutual fund (where there is no charge to invest further fund) might skew the results in favor of the mutual fund.
Lastly, even if you are one of the fortunate investors to come out ahead of the S&P500, you can now put a hard number on how much your time has been worth. Undoubtedly this has required research, stress, newspaper subscriptions, and time. Is the total amount of time worth the number displayed in the excel spreadsheet? This depends on you.

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Poll
You vs. S&P500?
o I don't know 5%
o I don't know, and won't do this to find out 18%
o I'm a day trader, this is too much work 0%
o I don't do stocks 40%
o S&P beat me by 50%+ 0%
o S&P beat me by 40-49% 0%
o S&P beat me by 30-39% 0%
o S&P beat me by 20-29% 0%
o S&P beat me by 10-19% 0%
o S&P beat me by 0-9% 8%
o I beat the S&P by 0-19% 8%
o beat the S&P by 20-29% 8%
o beat the S&P by 30-39% 2%
o beat the S&P by 40-49% 0%
o beat the S&P by 50%+ 8%

Votes: 37
Results | Other Polls

Related Links
o SPY
o example spreadsheet
o such as this
o this
o this page.
o this [2]
o Now add the stock tickers that you have not yet sold
o this will open a new spreadsheet
o Rightclick the worksheet name
o move it to the current spreadsheet you are working on
o Also by thefirelane


Display: Sort:
Should you bother picking stocks? A simple Excel Spreadsheet | 113 comments (90 topical, 23 editorial, 1 hidden)
I wouldn't give microSUCK the pleasure. (1.61 / 13) (#2)
by Josh Ferien on Sun Mar 26, 2006 at 01:34:22 PM EST

While some people might be willing to step on a dying baby to make some money on the stock market, others of us actually have moral standards and principles that say the ends don't justify the means. As an open source advocate, I only use software that has been tested and vetted by the free software foundation. That's why I use debian on all my computing devices -- NOT Micro$oft Office.

Let me remind all of the readers that Micorsoft is the leading software supplier of the U.S. MILITARY, an organization dedicated to the systematic elimination of women and children. When you make an Excel spreadsheet, you might as well have an abortion while you're at it, 'cause that's what you're doing: Killing babies.

It's time to put a stop to irresponsible investment practices like those advocated by the author of this piece. Instead, we need articles that promote socially responsible investing. It's time to stop giving into the monopolists who support the murder of children, the destruction of rainforests, and the theft of music and video entertainment.

I say enough.

Cordially,

Josh Ferien

The J is for Justice!

Interesting (2.16 / 6) (#4)
by Herring on Sun Mar 26, 2006 at 03:04:15 PM EST

Market principles:
  1. In an efficient market, all information is available to all people instantly.
  2. Therefore there are no arbitrage opportunities
  3. Therefore outperforming the market is a matter of luck and should go wrong as well as right just as often
Since people do outperform the market, 1 is false, therefore consistent winners do so on the basis of insider information.

Say lol what again motherfucker, say lol what again, I dare you, no I double dare you
-1 Mathematics are vendor-neutral (2.42 / 7) (#12)
by toulouse on Sun Mar 26, 2006 at 06:58:58 PM EST

Instead of explaining how to set up an Excel spreadsheet to perform the tasks outlined, it would have been much better to outline the data set, what you were trying to measure and why. Excel-specific instructions could then have been given as an example of the mathematical comparisons being made. This way, people could have concocted their own implementations using whichever technology they are most comfortable with; Excel macros are not necessarily the best tool for querying and manipulating remote data, for example.

Yes: Intelligent (or mind-numbingly bored) readers can reverse-engineer the data, algorithms and rationale from your hands-on description, but why should they? If your methods are valid, they will be valid regardless of the underlying technology.


--
'My god...it's full of blogs.' - ktakki
--


you could go through all that effort (2.50 / 2) (#13)
by thankyougustad on Sun Mar 26, 2006 at 07:14:14 PM EST

or you could just use yahoo's great portfolio tracker which does all that shit and more, automatically.

No no thanks no
Je n'aime que le bourbon
no no thanks no
c'est une affaire de goût.

+1 MS Excel (3.00 / 3) (#24)
by Psychopath on Mon Mar 27, 2006 at 01:28:43 PM EST

I am just again discovering what nice things one can do with MS Office.

Of course you have to know what is possible with it and what's not. Using MS Access, for example, as a DBMS is of course not possible. Using it for a nice address book with some 100-1000s entries works very nicely.

Same with Excel. A nice little product!
--
The only antidote to mental suffering is physical pain. -- Karl Marx

I am just curious..... (1.75 / 4) (#25)
by terryfunk on Mon Mar 27, 2006 at 01:30:40 PM EST

but why use a spreadsheet? Why not something like mysql, sqlite, or even Access?

I like you, I'll kill you last. - Killer Clown
The ScuttledMonkey: A Story Collection

I feel I must Respond (3.00 / 3) (#45)
by thefirelane on Mon Mar 27, 2006 at 11:58:48 PM EST

All the comments have been along several lines, unrelated to the actual topic. I thought I'd respond to them all here:

You are using Excel!?

Yes, use the tool that solves the problem! How many times have we said this about a language? I say the same thing for using software. Does OS software do what do here? I honestly don't know, can any of you answer whether Open Office can do web queries and VLOOKUP functions?

Secondly, if I were to describe this article in non-vendor specific ways, it wouldn't be useful. Everyone knows they should simply compare the change in S&P500 versus change in their stock. What I'm showing, is a specific way of making a useful tool using a commonly held bit of software

I don't need a system like this

Why? The point of this article is to simply measure your system of choosing stocks. If you don't know how good you are, how do you know you should continue? It could very well be that you are paying money to continue your stock picking hobby.

I can do this online service X

Please provide a link if you can. Many websites track all your transactions, but I have not found a site online that compares each of your transactions against an objective index, and sums this up to see your overall ability

-
Prube.com: Like K5, but with less point.

hot to use Excel? (2.00 / 3) (#57)
by United Fools on Tue Mar 28, 2006 at 07:01:37 PM EST

You know, there are many of us who do not know how to use Excel! What do we do?

We are united, we are fools, and we are America!
Why? (none / 0) (#58)
by jd on Tue Mar 28, 2006 at 07:20:16 PM EST

There are hundreds of stock tracking programs you can download for free, designed specifically to do all of this work without having to mess around with punching things in. Some even connect to online stock companies and allow you to do direct, automated trading.

If you do want to use a spreadsheet, why go for one that has features you'll never want or use? There's nothing in the article that would require anything more powerful than Visicalc - and you can't get much less powerful than that.

If you want serious overkill, then what's wrong with OpenOffice's spreadsheet? It'll work on most machines, most things that are valid on OpenOffice will be valid in Excel, but the converse doesn't hold up nearly as well.

Finally, tracking the value of stocks is rarely that useful. Stay diversified, buy when cheap, sell when doing well (but not yet topped out). That's the advice that most stock traders seem to give and they seem to do well from it.

kinda silly (none / 0) (#83)
by speek on Thu Mar 30, 2006 at 07:52:26 AM EST

I thought you were going to show me a great way to measure returns for an account to which one is continually adding some constant amount. Anyone who can add, subtract and multiply can figure out their returns on an initial lump sum.

--
al queda is kicking themsleves for not knowing about the levees

Stock Picking (none / 0) (#86)
by Grayworld on Thu Mar 30, 2006 at 05:36:40 PM EST

is not worth most people's time. But if you are going to do it, then you need to spend every available minute researching your portfolio and as little as possible measuring your return. In fact, I find looking at my account balances on line every few days works quite well in measuring my returns against the S&P or other benchmarks.

And as far as picking stocks, I find that spending some money on good investment letters leverages your time much more effectively than trying to search through a universe of thousands of publicly traded companies. The same is true in searching for mutual funds (Schwab offers decent mutual fund research if you have an account there).

It seems to me that most people ought to invest the bulk of their funds in ETF's or mutual funds and keep back a little slug of investable cash (10% to 20%) to go for the 5, 10 or 20 baggers using IBD or services like Motley Fool Hidden Gems. Getting a couple of those grand slams in your life is worth some time trying to achieve.


Fair but a bit unbalanced to be sure!

Must Mention Markowitz, Sharpe, & Miller (none / 0) (#90)
by rfhayes on Fri Mar 31, 2006 at 08:36:57 PM EST

A nice illustration of the impact of explicit transaction costs on investing. But even without these costs, it is *impossible* to beat the market over time by stock picking. You can increase your return by accepting increased risk, but eventually that increased risk will come home to roost. Harry Markowitz, along with William Sharpe and the late Mertron Miller, demonstrated this long ago. Yes, some stock picking portfolio managers may appear to do that well, but there are no more of them than the expected distribution of results would lead you to expect. There are portfolio managers who might actually be beating the market by exploiting inefficiencies in the way the market understands risk correlation. In some sense they are cousins of the firms that made money by implementing Black-Scholes on their option trading desks. In options, the advantage was born of a deeper understanding of the market structure. Eventually, everybody used an option pricing model and the easy money was no more.

Another gift from Markowitz: Index funds may be a better bet than ETFs like Spyders. The holdings of many index funds aren't *exactly* the same as the index. Instead, they hold an efficient subset (what Markowitz called a corner portfolio). This allows them to mirror the performance of the index without incurring the transaction costs (explicit and implicit) of trading the index exactly.

If anyone is interested on all of this, there is a spectacularly good book on the topic: "Active Portfolio Management" by Richard Grinold and Ronald Kahn.

-rfh

This is not new (none / 0) (#94)
by xmnemonic on Sat Apr 01, 2006 at 12:03:17 AM EST

Jim Cramer's "Real Money"
Ben Graham's "Intelligent Investor"
David Gardner's "Motley Fool Investment Guide For Teens"

All of these books, ranging from the faddish to the classical to the juvenile, state that index funds often do outperform most casual investors' stock portfolios.  This is no secret.

What a stupid guide (none / 0) (#98)
by Highlander on Sun Apr 02, 2006 at 05:57:25 PM EST

You completely forgot the payouts aka dividends.

But I suppose it is the American way to do stocks, just like running up the largest foreign debts never to be paid back.

Moderation in moderation is a good thing.

foreign stocks (none / 0) (#107)
by brinded on Mon Apr 03, 2006 at 08:23:42 PM EST

Thanks for the spreadsheet ideas - I've been trying to figure out how to use the lookup function for a while. One problem I now have is that MSN doesn't cover all European exchanges - in particular I need to find the ticker for Vestas in Denmark. Their ticker on yahoo is VWS.CO (Copenhagen), or VWS.DC also works. (note: there's a related stock on a German exchange but I need to track the price in Danish Kr.) Any help appreciated.

Hmm (none / 0) (#110)
by MissMatch on Sat May 13, 2006 at 03:13:33 PM EST

I am sure serious investors/smart investors have something like this, i doubt people randomly buy and sell stocks without calculating returns, but then agian, I thought it was common sense to have a chart like this etc. But this is a very good guide for those of who randomly buy/sell.

Beating index-funds, the easy way. (none / 0) (#111)
by Eivind on Tue May 30, 2006 at 07:09:13 AM EST

Actually it's easy to invest in such a manner as to, on the average, beat index-funds.

The method has two steps, they run like this:

  • Buy random stocks.
  • Wait.

Index-funds in general, by definition do almost as well as the market the indexes cover. (if not, the index-fund and/or the index itself sucks)

I said "almost" because the fund has associated costs, and transaction-costs, neither of which exist in the index itself. (the index is typically only a weigthed average of some stock-prices)

So, by minimizing transaction-costs and the costs imposed by the funds (the brookers working for the fund lives from something...) you end up beating the index-funds with, on the average precisely that much.

For example, if I wanted to track the Norwegian OSEBX index, I could buy an index-fund and immediately pay oh, around 1% in fees, and then thereafter 0.5% yearly for administration, plus actual transaction-costs, perhaps 0.2% or so.

Buying random stock cost me around 0.5% assuming I invest around $2000 in a single stock. (less if I invest more), yearly administration and transaction-costs thereafter are null, beating the index-fund by 0.5% to 0.7% on the average.

The only drawback is that your risk (in the sense of expected deviation, both positive and negative) will be higher unless you have enough to invest that you can spread it on *many* stock, and at the same time invest atleast $1000 or so in each to avoid the purchase-cost being prohibitive.

In practice, this only makes sense if you've got $25.000 or more to invest.



import live data? (none / 0) (#113)
by jago25 on Sat Nov 18, 2006 at 11:35:49 AM EST

I've always wanted to get interesting data sources into Excel for playing with.

Unfortunately this method means typing it in manually. Can't live data be brought in?

Should you bother picking stocks? A simple Excel Spreadsheet | 113 comments (90 topical, 23 editorial, 1 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest © 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!