Unrealized Gains (Again)

John Ralls jralls at ceridwen.us
Mon Mar 6 23:13:16 EST 2017


> On Mar 6, 2017, at 12:09 PM, David Carlson <david.carlson.417 at gmail.com> wrote:
> 
> Hi,
> 
> I am trying to track down errors in the unrealized gain in an IRA mutual
> fund that I have owned since 2005.
> 
> It starts out with a purchase of 1,373.848 shares for a total of $20,081.54
> at $14.62 per share.  This generates a $4.72 (0.02%)discrepancy right off
> the bat, as those shares have a value of $20, 085.66.  Then as dividends
> are reinvested, more errors accrue, sometimes averaging out, sometimes
> not.
> 
> I am using average cost for sales, calculated in a separate spreadsheet to
> determine the realized gain for sales.  The broker did not then and still
> does not report realized gains in this IRA.
> 
> After all transactions are entered with realized gains matching the
> spreadsheet, I am left with an error of $4.13 in the unrealized gain on
> December 31, 2016 when comparing a balance sheet report to the
> spreadsheet.  I have the spreadsheet set to show average costs to four
> decimal places, which I round off in the realized gain entries in GnuCash.
> 
> My question is do I have to live with errors of several dollars in
> unrealized gains in large value holdings when the percentage is reasonable
> for  1/1000 share resolution?
> 
> Or is there some way to reduce the apparent errors?

There is a way to prevent the errors: Don't enter the price, enter the value. Your actual price in that original buy was 14.617/share.

Remember that GnuCash saves the amount (i.e. the number of shares) and the value (the total currency paid or received for the shares). When you enter a two-commodity transaction GnuCash makes sure that amount * price = value, and if you enter two of them GnuCash will compute the third, if you enter all three and the result isn't right GnuCash will ask you what to adjust. You *always* want GnuCash to compute the price. Always. That's because if you feed it a rounded price you get an inexact result 
in either amount or value, and that's what gets stored. If you give it the exact amount and value then it might display a rounded price, but the stored amount and value are correct and GnuCash will always recalculate the price and maybe round it for display so there's no error.

Regards,
John Ralls



More information about the gnucash-user mailing list