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
Hi RK,
Which part of this is giving you trouble? If you are asking about how to calculate an IRR, then I will be no help, as I am totally clueless about financial calcuations.
But if you just need to know how to plug values into a formula, then which function you are using really doesn't matter all that much. It's just a question of passing in the appropriate references to the function. And there are lots of samples of this included with NetAdvantage under the UltraCalcManager samples.
Hi Mike,
In excel say if we put below values and calculate IRR it gives the value of 7%.
-25
-10
0
10
35
=IRR(A1:A5) returns 7% as result
By using UltraCalcFunctionIRR how can I achieve the same?
I looked at the sample and I did see the samples of using Infragistics.Win.CalcEngine.UltraCalcFunction but none of the samples talk about using Infragistics.Win.CalcEngine.UltraCalcFunctionIRR.
Can you send me a sample of code which will use the IRR method which will take the above values and return me 7% value as shown above.
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] )
Perfect.
That's what I was looking for. Thx a lot 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
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.
Thx Mike.