Hi,
Need an assistance in using UltraCalcFunctionIRR class to calculates an internal rate of return for a given series of cash flow . Can some one share sample code for the same?
Regards,
RK
Thx Mike.
Hi RK,
There's no built-in XIRR function. You could write your own - there's a sample included with NetAdvantage that shows how to create your own function libraries.
You should also Submit a feature request to Infragistics and maybe this functional can be added in a future release.
Hi Mike,
One more thing though.
How can I calculate XIRR using Infragistics. I tried looking all the financial functions exposed by infragistics and could not find anyone.
In excel for the below sample data set XIRR values is 78 % using the formula =XIRR(A1:A4,B1:B4)
300
4/12/2010
-110
5/12/2010
6/12/2010
7/12/2010
Thanks for your help.
Regards
Perfect.
That's what I was looking for. Thx a lot Mike.
Okay, now I see where you are getting stuck. :)
It looks like the IRR function for CalcManager takes only two parameters. The first is a set of Values, so this would have to be an enumerated reference, such as a grid column. The second is a guess, which requires a single value, so you could use a control like a TextBox or a Label or even a NamedReference.
The way I found this out is by placing a TextBox and an UltraCalcManager control on a form. Then I went to the TextBox properties and looked at CalcSettings.Formula which brings up the FormulaBuilder Dialog. I then switched to the Functions tab and double-clicked on the IRR function which brings up the FunctionBuilderDialog and gives me a list of the parameters that the function takes and a description of each one.
So the formula in this case would look something like this:
IRR( [//ultraGrid1/Band 0/Values], [//txtGuess] )