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 Mike,
I was looking at one of the samples from the below locationC:\Documents and Settings\All Users\Documents\Infragistics\NetAdvantage 2009.2\Windows Forms\Samples\WinCalcManager\CS\Basic Math CS
In that to calulate sum you are using the formula SUM( [//txtSumFunction1] , [//txtSumFunction2] , [//txtSumFunction3] , [//txtSumFunction4] ). Which works perfect.
To calulate IRR I changed the formula to
IRR( [//txtSumFunction1] , [//txtSumFunction2] , [//txtSumFunction3] , [//txtSumFunction4] ). Once I run the application I am getting the below error
The function 'IRR' referenced at line 1 col 1 does not contain the correct number of arguments. The argument count should not exceed 2 parameter(s).
Please can you tell what I am doing wrong here.
Regards
It depends where these values are stored. Where are you storing the parameters you want to pass into the IRR function? I don't think it's possible to do this in a vertical stack like this and specify a range. You would have to use the IRR function and pass in each param as a separate value, separated by commas.
If you wanted to pass in literals, you could use formula like this:
"IRR(-25, -1, 0, 10, 30)"
But it might also depend on what you are applying this formula to, in addition to where the values are coming from.
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.
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.