TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ako Musha
NA
28
12.2k
How to calculate internal rate of return (IRR)?
Oct 18 2018 2:25 PM
I have a column in a DataGridView which includes before tax cash flow values. Could someone please help me to calculate the IRR (Internal Rate of Return)?
Here is what I have done so far, but getting an error when trying to calculate the IRR function:
Error: Value of type 'Double' cannot be converted to '1-dimensional array of Double. this error refers to "val" in the IRR function.
Thanks so much for your help! Please consider that, I am new and just start coding VB, thanks !!
What I have tried:
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 = "
& Format(cal,
CStr
(prec)) &
" % "
)
Text1.Text=cal
Next
Next
Reply
Answers (
1
)
How to concatinate customize primary ID every new entry.
What would be the output for this program?