Portfolio Capital Gains Spreadsheet

advertisement
Portfolio Capital Gains Spreadsheet
Version 0.00
Copyright © 2002 Anders Johnson, <anders@ieee.org>
Legal Notice
This spreadsheet is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with this
program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
The GNU General Public License may also be found at
http://www.gnu.org/copyleft/gpl.html.
The author further specifically requires that if any portion of this spreadsheet is
password protected, then any such passwords must be clearly disclosed in the
README file (this document) when the spreadsheet is distributed. This requirement
shall remain in force notwithstanding any determination as to whether this requirement is
implied by the GNU General Public License.
In light of the fact that important financial decisions might be based on this spreadsheet,
the author reiterates that he shall accept no responsibility whatsoever for it. The author
does not represent himself as an expert in the field of tax, law, finance, or any other field.
If you distribute this spreadsheet or any work derived therefrom, then any such
distribution must satisfy the following requirements:
1. The README file (this document) must accompany the spreadsheet,
2. This Legal Notice must remain intact and be prominently displayed, AND
3. The Legal Notice in the spreadsheet must remain intact and be prominently
displayed.
Description
This spreadsheet can be used to track transactions with respect to a portfolio of securities,
as well as to calculate the tax implications of those transactions for a given tax year.
Each security is represented by its own worksheet. In addition, the first worksheet serves
as the index, and the last worksheet serves as a template for future worksheets.
Worksheets that represent a security should be renamed to match the security’s trading
symbol. The “Security” field (cell C1) is automatically updated to match the sheet name
when the sheet is deactivated (e.g. by selecting another sheet).
README
Page 1 of 4
3/8/2016
Portfolio Capital Gains Spreadsheet
Version 0.00
The Index Sheet
On the “Index” sheet, you can select the tax year of interest in cell C2. (It is assumed that
the tax year coincides with the same calendar year.) This sheet shows a security-bysecurity summary of the tax implications of sales during the selected tax year, as well as
the “Unrealized” tax implications of selling any remaining held securities before the end
of the tax year. Totals are also shown (on line 11).
Unrealized Gains
An unrealized gain or loss is considered long term if it would qualify as a long-term gain
were the security to be sold immediately. Otherwise, it is considered “conditional” term if
it would qualify as a long-term gain were the security to be sold at the end of the
specified tax year. Otherwise, it is considered short term. Unrealized gains and losses are
shown independently, because it is possible to control the tax implications of sales by
selecting batches with a favorable basis (although this may require designating to your
broker the batches you are selling, and your broker must keep this information on file).
Unrealized gains are always reported without regard to the commission that must be paid
to realize them. The actual realized gain will be diminished accordingly.
Adding Sheets
The easiest way to add a new sheet is to click the “Add Sheet” button on the “Index”
sheet. This copies the “Blank” sheet to a new sheet called “new”, which you should
rename immediately. (It will fail without side effects if there is already a sheet called
“new”.) You should avoid plugging any numbers into the “Blank” sheet, because it is not
reflected in the “Index” sheet, and it affects any sheets generated in the future.
If you have more than a few securities in your portfolio, it is recommended that you
alphabetize sheets by symbol.
Securities Worksheets
Each worksheet corresponding to a security is structured as a number of up to 998
Bought actions (10 of them by default), each of which is followed by up to 9 associated
Sold actions (2 by default). If a given batch is sold in more than 9 different events, then
the batch can be split into multiple Bought actions after the fact. You can use Copy and
Paste to add more actions. The Bought actions are identified by being colored cyan
(mnemonic: “Blue” and “Bought” both start with “B”).
For each action, you need to specify the date, the quantity, the price, and the commission.
For Sold actions, the quantity should be negative. You can expand lines 9-17 (by clicking
on the “+” at line 18) to see a short definition of terms.
The current market price of the security should be entered in cell C2 of its worksheet,
such that unrealized gains can be calculated.
Splits & Conversions
To deal with a split or conversion of a security (wherein the number of shares changes
without affecting the amount of equity), there is a “Split” button on line 10. To use it, you
README
Page 2 of 4
3/8/2016
Portfolio Capital Gains Spreadsheet
Version 0.00
must expand lines 9-17. Then, enter the split factor in cell C10, press “Enter” and click
the “Split” button. In order for this to work, the values in the Qty and Price columns
must not be formulas. Because splits can be confusing, it is recommended that you save
your work first.
If the security symbol changes (for example, due to a merger), then it is recommended
that you make a note of the original symbol (as it was purchased) in the Comments
column of the Bought action line.
Short Sales
The best way to account for short sales is to use a negative Qty for the Bought action and
positive Qty for the Sold actions. In order to minimize confusion, you should change the
names of the actions from Bought and Sold to Short and Cover, respectively, even
though those actions are semantically similar. An important difference is that gains and
losses from a short position are always considered short-term, regardless of the interval
between the Short and Cover actions.
Note that any sale of a security that you already hold (or one that is “substantially
identical” to a security you hold – whatever that means) is considered a sale of your
holdings rather than a short. Similarly, any purchase of a security that you are short is
considered a cover rather than a buy. You’ll need to be careful to make sure that the
spreadsheet reflects this.
Auditing
Each security’s worksheet has an “Audit” button near cell D1. Clicking this button
checks the following things:
1. The action is Bought, Sold, Short, or Cover.
2. The Bought and Short actions are in chronological order.
3. The Sold and Cover actions are paired with Bought and Short actions,
respectively.
4. The Sold and Cover actions are in chronological order, and take place after the
Bought or Sold action with which they are paired.
5. The signs of the Qty, Price, Commission and Remaining columns are correct.
6. A Short action does not occur with a positive position, and a Bought action does
not occur with a negative position.
Errors are reported by selecting the cell in question and displaying a message box.
Canceling the message box terminates the audit with no further checking.
Future Work
I’d like Sold and Cover actions that took place during the selected tax year to have their
line highlighted in yellow. This involves triggering off of changes, which is possible in
Excel.
README
Page 3 of 4
3/8/2016
Portfolio Capital Gains Spreadsheet
Version 0.00
The determination of the term (long, short or conditional) uses some simplifying
approximations. In some cases it will be inaccurate. This ought to be fixed.
The spreadsheet does not address “wash sale” rules at all. Something ought to be done
about this, but it’s difficult because the rules are both complex and unclear.
Submitting Patches
You are encouraged to submit patches to anders@ieee.org if you have any improvements.
However, please keep the following in mind:
1. I will be very upset with you if you send me a virus.
2. The version that I’m currently working on is almost certainly not the same as the
version you started with, and there is no way to “diff” or “merge” on Excel.
Therefore, I can only accept changes that are highlighted via Tools » Track
Changes » Highlight Changes or Insert » Comment.
3. Reviewing and accepting changes is a manual and time-consuming process, so
don’t be surprised if it takes me a while to get around to it.
4. Leave the release number that you started with in cell A8 of the “Index”
worksheet. Put some text in cell A9 so that I know that there are changes relative
to that release.
5. By submitting a patch, you implicitly grant the recipient a nonexclusive license to
use and distribute the patch without restriction.
Why Microsoft Office?
You are correct to question why this spreadsheet should be developed under Microsoft
Office, which is a closed system. This is mainly out of pragmatism; that is, Microsoft
Excel is ubiquitous, and it doesn’t suck nearly as much as it used to.
Nonetheless, in order to maximize portability, we try to refrain from using proprietary
features unnecessarily.
README
Page 4 of 4
3/8/2016
Download