title: How to calculate Internal Rate of Return (IRR)?
body: <p>I've modified my original question....</p>
  
  <p>I have a column in a <code>DataGridView</code> which includes before tax cash flow values.<br>
  Could someone please help me to calculate the IRR (Internal Rate of Return)?</p>
  
  <p>Here is what I have done so far, but getting an error when trying to calculate the IRR function:</p>
  
  <p>Error: Value of type 'Double' cannot be converted to '1-dimensional array of Double. this error refers to "val" in the IRR function. </p>
  
  <p>Thanks so much for your help! Please consider that, I am new and just start coding VB, thanks !!</p>
  
  <pre><code>Dim prec As String  "###,##0.00"
  Dim guess As Double=0.1
  
  For i =0 to DataGridView1.Rows.Count -1
  For j =0 to DataGridView1.Rows.Count -1
  
  Dim value(j) As Double
  Dim val As Double
  value(j) = DataGridView1.Rows(i).Cells(0).Value
  
  value(j)=val
  Dim cal As Double = IRR(val,guess) * 100
  
  MsBox("IRR = " &amp; Format(cal, CStr(prec)) &amp; " % ")
  Text1.Text=cal
  
  Next
  Next
  </code></pre>