XIRR Calculation
How do I calculate Excel's XIRR function using C#? According to XIRR function openoffice documentation (formula is same as in excel) you need to solve for XIRR variable in the following f(xirr) equation: You can calculate xirr value by: calculating derivative of above function -> f '(xirr) after having f(xirr) and f'(xirr) you can solve for xirr value by using iterative Newton's method - famous formula-> EDIT I've got a bit of time so, here it is - complete C# code for XIRR calculation: class xirr { public const double tol = 0.001; public delegate double fx(double x); public static fx