Pages

Wednesday, August 13, 2014

c# IRR function:Arguments not valid exception

I would like to provide you two points of view from the document of this method:

1. The first parameter "ValueArray" is the array of Double specifying cash flow values. The array must contain at least one negative value (a payment) and one positive value (a receipt).

2. The IRR function uses the order of values within the array to interpret the order of payments and receipts. Be sure to enter your payment and receipt values in the correct sequence. The cash flow for each period does not need to be fixed, as it is for an annuity.


Example:

 List<double> items = new List<double>();
            items.Add(-10000);
            items.Add(30000);
            items.Add(50000);
            items.Add(50000);
            double[] itemsArray = items.ToArray();

Hope i will help all financial domain developers..enj...all the best 

No comments:

Post a Comment