Skip to content

xirr bug? #31

@josh-m-sharpe

Description

@josh-m-sharpe

Good Doc's xirr() thinks the result should be: 0.1877607042

The result should certainly be positive.

DATA:
5/3/2010   --   -3984.732
8/12/2010  --   -1877.98
6/2/2014   --    11684.915242
2.0.0-p353 :044 > trans = []
 => []
2.0.0-p353 :045 > trans << Finance::Transaction.new(-3984.732, date: Date.civil(2010, 5, 3).to_time)
 => [Transaction(-3984.732)]
2.0.0-p353 :046 > trans << Finance::Transaction.new(-1877.98, date: Date.civil(2010, 8, 12).to_time)
 => [Transaction(-3984.732), Transaction(-1877.98)]
2.0.0-p353 :047 > trans << Finance::Transaction.new(11684.915242, date: Date.civil(2014, 6, 2).to_time)
 => [Transaction(-3984.732), Transaction(-1877.98), Transaction(11684.915242)]
2.0.0-p353 :048 > trans.xirr.apr.to_f
 => -2.212298586260735

untitled_spreadsheet_-_google_sheets_and_1__tmux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions