Using a spreadsheet to maintain a portfolio
Investors should look at all of their accounts as a unified portfolio to construct a portfolio that is low cost, well diversified, and tax efficient. Those who are new to the concept are often overwhelmed by the complexity involved in maintaining such a portfolio. Using a spreadsheet to maintain a portfolio is intended to suggest one way of easing the burden.
Contents
Asset allocation
One of the easiest ways to maintain your portfolio is to categorize by asset allocation, like so:
Account  Domestic stocks 
REITs  International stocks 
Bonds  Total 

Taxable      $14,000    $14,000 
Roth IRA    $9,000  $9,000    $18,000 
401(k)  $49,000      $19,000  $68,000 
Total  $49,000  $9,000  $23,000  $19,000  $100,000 
Desired  $48,000  $8,000  $24,000  $20,000  $100,000 
Difference  ($1,000)  ($1,000)  $1,000  $1,000   
 Cells in the rows for Taxable, Roth IRA, and 401(k) should be manually entered. All other cells can be automatically calculated.
 Each cell in the Total row represents the total amount of domestic stocks, that of real estate investment trusts (REITs), and so on.
 The Desired row represents the desired amount of dollars in each asset class and can be calculated by multiplying the value of your portfolio by the percentages in your target asset allocation.
 The Difference row tells you how far off your portfolio is relative to your desired asset allocation. It can be calculated by subtracting a cell in the Total row from the corresponding cell in the Desired row.
Sample spreadsheets
 Here is a sample spreadsheet in this style. It includes the additional features above; it can also adjust for the different aftertax value of assets in different accounts, and combine multiple subclasses into one class (so that you may have a target allocation to foreign stocks, and separate targets for developed and emerging markets). A simpler version is also available; it does not track subclasses.
 One important aspect of of maintaining your asset allocation is to do periodic rebalancing. A sample rebalancing spreadsheet is available from Google Drive (by forum member LadyGeek).^{[1]} Three example approaches are used, which could be incorporated into any of the sample spreadsheets.
 Asset Allocation Spreadsheet  a Google spreadsheet created by Hoppy08520, with a link to documentation, that can help setup a multiaccount portfolio.
Suggested improvements
 You might want to make a separate Target row to keep track of your target allocation; in that case, the Desired row would be the product of the Target row and the total portfolio.
 Similarly, you might make an Actual row to compute your percentage allocation, so that you could compare your target percentages to your actual percentages.
 If you have funds which cover multiple asset classes, you can put each fund in a different row, make an extra column for the total fund value, and have the spreadsheet automatically compute the amount of the fund which is in each class. This allows you to easily track the effect on your allocation of adding $10,000 to a balanced fund.
Asset allocation visualized
tfb's article, Cascading Asset Allocation Method, describes how to select a portfolio's asset allocation by visualizing the process as a topdown hierarchy. The most important selection is at the top (stocks/bonds), which then breaks down into smaller asset classes. Selection of the actual funds is done last, which is at the bottom of the chart. Two spreadsheets are available.
First, forum member pradador has created a spreadsheet which allows one to create a portfolio by following the advice in the article. The spreadsheet is available on Google Drive: Cascading Asset Allocation (The spreadsheet was further modified by forum member LadyGeek to include error checking.)^{[2]}
This spreadsheet includes a fixed income major asset category, which is not mentioned in the article. There is no consensus on the role of fixed income in a portfolio; it's dependent on your situation. If fixed income is considered as a bond, then set the percentage of Fixed Income to 0.
There are two tabs:
 Top Down: Starting on the left side and proceed to the right, enter the desired asset allocations to arrive at the percentage of each fund's contribution to your portfolio. The bottom row is reserved for error checking. If an entry error is made (the percentages do not add up to 100%), an error will be displayed.
 Bottom Up: Use this tab to determine the asset allocation percentages of your portfolio when you know the funds. In the rightmost column, enter the percentages and funds. The spreadsheet will work left and arrive at the asset allocations. The blank cell in the lower rightmost corner will display an error if the percentage does not add up to 100%.
Forum member Ducks has another variation. The first page breaks down your asset allocation. The second page checks how close you are to your desired allocation and helps you figure out how to rebalance.
Track your portfolio in realtime
Spreadsheets by forum member swimirvine determine your asset allocation in a colorful way using realtime fund information. They also help with portfolio rebalancing. Be sure to align each fund with its associated asset class category across all of the account types, e.g. Large caps as the first entry should have a large cap fund as the first entry in all the account types.
 Google Sheets: swimirvine portfolio manager Copy this file to your Google Drive account; as it contains Google Finance functions which only work online from within Google. Google Finance functions limit realtime information to mutual funds; for exchangetraded funds (ETFs) the expense ratios will have to be added manually.
 MS Excel: swimirvine portfolio manager.xlsm. The Yahoo! Groups EXCEL Stock Market Functions Addin must be installed; subscribe to this group to download (access is immediate). Realtime expense ratios for ETFs and mutual funds are supported.^{[note 1]}
How to use a proxy fund
Google Finance offers historical and realtime securities information using the GoogleFinance() function in Google Sheets.
If you have funds held in a Collective Investment Trust (CIT), in which there is no ticker symbol, then you can use a proxy fund to keep your balance roughly up to date using the GoogleFinance functions in Google spreadsheets.^{[note 2]}
For example, suppose you hold the government's Thrift Savings Plan C Fund, which is a collective investment trust (CIT) that tracks the S&P 500 index. Find out the closing price of the CIT on the current day, and also find a similar proxy fund, such as Vanguard's institutional index fund (VINIX).
For example, suppose the C Fund's closing price is $23.6602 and Vanguard's VINIX is $167.75. This means that a share of the C Fund is worth 7.08 times a share of VINIX (167.75/23.6602).
To maintain a realtime estimate of your C Fund balance without needing to update the C Fund's share price every day, you can instead take the daily price of VINIX and divide it by the multiplier to get an approximate share price for the C Fund.
For example, these could be the cell along a row in your spreadsheet and this is what you would enter into them.
Cell  Heading  Enter  Notes 

A2  Shares  100  Enter the number of shares you have in the Collective Index Trust (CIT). As you add or subtract shares from contributions, withdrawals or exchanges, you'll need to periodically update this amount. 
B2  Closing Price  23.6602  Enter the CIT's closing price. You'll need to look this up in your plan. 
C2  Close Date  01/03/2014  Enter the closing date on which you got the "Closing Price" of the CIT in B2. Make sure you enter the date and closing price are in sync, and be sure that the closing price has been updated in case there is a lag between the market close and the posting of the closing prices. 
D2  Proxy Fund  VINIX  Enter the ticker of a fund that is similar to your CIT. 
E2  Proxy Price  =INDEX(GoogleFinance(D2, "close", C2); 2; 2 )  This returns the closing price of the proxy fund you selected in D2, on the date C2, which is the same date you recorded the closing price of the CIT. 
F2  Multiplier  =E2/B2  This is the ratio of the Proxy Fund's Price divided by your CIT's price, on the same date. 
G2  Proxy Fund Current Price  =GoogleFinance(D2, "price")  The current price of your proxy fund 
H2  CIT Approx Price  =G2/F2  This is the approximate calculated share price of the CIT 
I2  Balance  =H2*A2  The approximate balance you hold in the CIT. This is the approximated price of the CIT multiplied by the number of shares you hold in the CIT. 
To keep this reasonably uptodate and to prevent the "multiplier" from drifting over time, from time to time you can replace the date in cell C2 and the actual closing price of the CIT in cell B2.
Realtime tracking from a website
Another technique is to find a website that outputs the price of the trust in realtime (or near realtime) and then use the GoogleFinance ImportHmtl() function to "scrape" the HTML from the page.
If the ImportHtml() function can scrape that data cleanly into defined rows and columns with the price landing in a single cell, then you can then use the INDEX function to get the value of a particular cell by referencing its row and column. Two examples are described in the Bogleheads forum:
 GoogleFinance price quotes for TSP Funds
 How to import TIAACREF annuity unit values into Google Docs
Rate of return
See also: Internal rate of return, Calculating personal returns
A spreadsheet to calculate investor and portfolio returns is provided in Calculating personal returns. It allows Bogleheads to report their personal returns in a uniform manner.
If you know the dates you made your investment contributions and your withdrawals, the XIRR (Internal Rate of Return) spreadsheet function is the best and most accurate method for calculating your rate of return. This method is far more accurate than annual average returns, as contributions and withdrawals (cash flows) are weighted for both time and value.^{[3]}^{[note 3]}
The forum discussion thread XIRR function again has details and a working example.^{[note 4]}
Tax lot tracking
Another use of a spreadsheet is to keep track of share lots in a taxable account, so that you can automatically compute the capital gain or loss when you sell, and easily see which shares should be sold for tax loss harvesting or to minimize the tax cost of selling. A spreadsheet for tax lots could look like this:
Date bought 
Amount invested 
Share price 
Shares  Date sold 
Share price 
Amount received 
Capital gain 

2/1/08  $5000  $20.00  250.000  10/31/08  $15.00  $3750  $1250 
5/1/08  $5000  $18.00  277.778         
7/1/10  $10000  $30.00  333.333  2/1/11  $33.00  $11000  $1000 
Sample spreadsheets
 Here are three versions of a spreadsheet for tracking tax lots, and computing the capital gains and losses on each sale. There is a version for stocks or ETFs, most mutual funds, and funds with purchase and redemption fees. In a brokerage account, you would make one sheet in a workbook for each holding. The worksheets adjust for stock splits and share class conversions, but if you sell part of a lot, you have to split the lot into two purchases manually.
Performance tracking
 Mattman22 created a spreadsheet he calls "My Personal Index." Here is the Excel 2007 version. His description: "This Excel workbook will help you effectively track the performance of your investment portfolio. The workbook has been designed to handle all of the calculations for you and gather the data; all you need to do is provide the tickers and shares. The spreadsheet makes extensive use of behind the scenes VBA code to effectively compute a pseudo mutual fund based on personal data (using a NAV)." ^{[note 5]}
Portfolio tools
In addition to the spreadsheets there are various utilities to design and manage portfolios that span multiple accounts. Most tools cannot automatically compose your ideal portfolio, but you can use the tools to enter two or three models that you composed, and then you can compare and contrast the results, looking in particular at the blended expense ratios and the totals of each asset class. Two popular tools are:
 Vanguard Portfolio Watch is an online tool for Vanguard clients to track asset allocation.
 Morningstar Instant XRay is a tool especially useful for breaking down a portfolio into asset allocations and style boxes.
Notes
 ↑ Cells containing the addin functions may display a #NAME? error. There is nothing wrong, Excel just needs to know where the addin is installed. In MS Excel 2010, Data > Edit Links > Change Source... then navigate to the folder where the addin is installed.
 ↑ Proxy fund: A fund used to represent another fund. The Cfund does not have a ticker symbol. In its place, the Vanguard institutional index fund (VINIX) is used to represent the Cfund. The Vanguard fund is the proxy for the Cfund.
 ↑ Internal refers to the fact that its calculation does not incorporate environmental factors, e.g., the interest rate or inflation. Reference: Internal rate of return, from Wikipedia
 ↑ XIRR function again also describes a bug in MS Excel's XIRR() function. This bug is not present in LibreOffice or Google Drive Sheets.
 ↑ This spreadsheet has been superseded by a standalone application. See: My Personal Index  Now a Standalone Application, forum discussion.
See also
References
 ↑ To download, select File > Download As > Excel or OpenDocument.
 ↑ Cascading Asset Allocation Spreadsheet, forum discussion.
 ↑ Using XIRR in Excel, forum discussion
External links
 LibreOffice Calc, a free opensource spreadsheet that's compatible with Microsoft Excel. Available for Microsoft Windows, Linux, and Mac OS X.



