gristlabs / grist-core

Grist is the evolution of spreadsheets.
https://www.getgrist.com/
Apache License 2.0
7k stars 311 forks source link

IRR/XIRR functions? #1176

Open xkcd386at opened 3 weeks ago

xkcd386at commented 3 weeks ago

Describe the problem to be solved

I just discovered grist, and it looks absolutely amazing -- kudos to all of you for such a fantastic tool.

While trying to find use cases for it in my personal life, one gap I found was the lack of IRR/XIRR (internal rate of return) functions. Not sure if this would be something that is easy or hard or even possible, but thought I'd mention it.

Thanks again for a very nice and easy to use product.

Describe the solution you would like

The IRR and XIRR functions in XLS or LibreOffice take a column of numbers (at least one positive and one negative, the others can be whichever) and an equal sized column of dates, and computes a "rate of return". I apologise I'm not that familiar with the exact formula used behind the scenes of these functions.

Edited to add: LibreOffice (and Excel I assume) have a lot more financial functions. IRR/XIRR happen to be the only ones I care about, but there may be others that are important in general.

dsagal commented 3 weeks ago

I'd say this relates to #35 (Support data science libraries). If that were available, numpy contains the irr function, and there are other libraries that may offer more, e.g. pyxirr.

xkcd386at commented 3 weeks ago

thanks, though these functions are more properly "financial" functions -- but maybe that's just semantics.