How I use Google Sheets to track my portfolio

Regular readers of my blog have probably noticed that I use Google Sheets for almost everything. I use it to track the live net asset values of various companies, I built my valuation models in Google Sheets and everything is tied together in a master portfolio sheet (some if its functionality you can glimpse from my performance review posts) . A few years ago I wrote a short tutorial that explained how you can add realtime price information in Google Sheets for stocks that aren’t support by the standaard =GoogleFinance() function.

What I’ll be focusing on today is how you can pull data from multiple documents to create one sheet with a nice overview of everything. To make this easy it’s smart to standardize your documents a bit. What I do is that when I value a company there is always a sheet called “Thesis” that has a few standardized items at fixes positions, like this:

The price target links to a valuation model in a different sheet (but in the same document), the price (in this case) comes from the =GoogleFinance() function and the last update cell is useful to keep track if I have updated my valuation recently. As you can see here I should probably take a little bit of time soon to update my Pardee Resources valuation. If you make it a habit of doing this for everything your research you can make a nice portfolio sheet that tracks realtime how much upside every position has remaining. Part of my portfolio sheet looks like this:


For obvious reasons I have hidden the number of shares I own, and the value of every position, but you can see how I have an price target for every position that is updated automatically based on the latest price. To pull data from a different document in the sheet we can use the =ImportRange() command. It requires two arguments, one is the url of the sheet where you want to pull the data from, and the second one is the reference to the cell you want to pull the data from. So it would look something like this:

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/blabla/edit#gid=123456789","thesis!C15")

After entering this function in a cell you initially get an error message. Hover with the mouse cursor above the error message, and you will see that a small pop-up that asks if you want to give your sheet access to the other sheet. Do this, and the data will appear :).

Combined with the option to get realtime prices (as discussed in my old tutorial) you have an incredible toolset to make a fancy spreadsheet.  Not only will this give a quick overview of which positions are perhaps becoming more or less attractive, it’s also easy to build a watchlist like this (I have done this as well). Everything that you researched, but didn’t buy can be put in that list together with positions that you have sold in the past.

One limitation to keep in mind is that Google isn’t happy if one sheet requires to much calls to outside sources, and by making one sheet dependent on tons of other sheets the number of calls can explode quickly. So you will have to try to not invoke to many =ImportHTML() and =ImportXML() functions in all the combined sheets in order not to break things.

Disclosure

Author is long the stuff in the sheet

13 thoughts on “How I use Google Sheets to track my portfolio

  1. Matt Jones

    Did you have a background in this stuff? I’ve tried to figure out the import xml thing but I started to feel like I was going to have to become a programmer to understand it. I have sometimes been able to get it to work by trial and error and looking at what other people have done but I don’t really understand it, and usually they change something about the page later on and the reference quits working (I’m guessing that’s what is going on) at which point I am lost. My computer skill level is probably fairly low though.

    Reply
      1. Peter Nicholls

        Ever used GitHub Alpha?

        I am software dev myself, wondering if a “GitHub for Investing” would be a useful tool.

        Reply
  2. Paul

    I have a very similar setup. Yes, got inspired by your Google Sheets use long ago, but funny to see how much it converged.

    How do you take care of the sorting on position size? The sorting function seems to break any dependent cells on the same or other sheets. Of course this can be settled by reorganizing the data or using a separate presentation sheet, but it’d rather avoid that.

    I put everything in the same workbook, but I have the impression it gets slower the more sheets I add to the deck.

    The random behavior on errors with ImportHTML and ImportXML are also not ideal. But it’s not as if there’s a real alternative.

    Reply
    1. Alpha Vulture Post author

      I have no problems with the sorting function. In the sheet pictured in the post every company has one line, and if the data isn’t entered there directly it’s coming from a different sheet.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *