473,418 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Net IRR formula

Hi,

Please could someone point me in the right direction with a formula I am trying to create which will enable me to calculate a Net IRR for a series of data?

My Problem:
•My formula in Excel is currently too long, complicated and slow
•I am currently using the IRR function on a series of cashflows. eg =IRR(cashflow,0.01)
•I am trying to create a formula called NetIRR(cashflow, fee, hurdle, compound) which will ultimately perform an IRR calculation on the range {cashflow}, after the formula has stepped through each cell in the range and amended the value of the monthly cashflow using the three other fixed variables {fee, hurdle, compound}.

I think I will be able to write the code to amend each monthly cashflow (formula below is just as an example), but I am struggling on how to structure and step through this new function.

I guess that the code might follow the form of (in theory – not VB!)

Function NetIRR(Cashflow, fee, hurdle, compound)
month=1
Start loop
NetCashflow(month) = Cashflow(month) * fee – hurdle * compound
End loop (when last month in range cashflow has been reached)

NetIRR = IRR(NetCashflow,0.01)

End function


If anyone can help me in any way I'd very much appreciate it!!
Thanks

James
Sep 19 '07 #1
1 5918
kadghar
1,295 Expert 1GB
...I guess that the code might follow the form of (in theory – not VB!)

Function NetIRR(Cashflow, fee, hurdle, compound)
month=1
Start loop
NetCashflow(month) = Cashflow(month) * fee – hurdle * compound
End loop (when last month in range cashflow has been reached)

NetIRR = IRR(NetCashflow,0.01)

James
if you create a public function, you'll be able to use it in an excel worksheet, but it wont be much faster than the one you already have, but you can put it into a procedure to create an array of results and then just put them into excel.

i think your function should look like this in vb:

public function NetIRR( byval CFlow as double, Fee as double, Hurdle as single, Cmp as single) as single
dim month as integer
dim NCFlow() as double
redim NCFlow(lbound(cflow) to ubound(cflow))
for month = lbound(cflow) to ubound(cflow)
netcashflow(m) = cashflow(m)*fee - hurdle*cmp
next
NetIRR =IRR(ncflow,0.01)
end function

now you only need a function called IRR that gives you the internal rate of return

Please note that cFlow must be an array
Sep 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ernie | last post by:
Hi, I spent more than an hour wondering why the following works in my Python 2.3.4 Linux box: formula = """ def dummy(): print "This is Ok!" """
2
by: celsius | last post by:
Hi folks, Al Bowers wrote this program on comp.lang.c Date: 2001-07-09 13:41:58 PST #include <stdio.h> int isleap (unsigned yr); static unsigned months_to_days (unsigned month); static long...
2
by: alex | last post by:
I need a more advanced formula than just an average for calculating items rating. I have: raitng value is on scale 1 to 10. s - sum of all ratings for an item n - number of rates (votes)
0
by: RJN | last post by:
Hi I have a main report and a sub report. I have a formula field on the main report and one on the sub report. I want the formula in the subreport to be evaluated after the formula in the main...
0
by: RJN | last post by:
Hi Sorry for posting this message again. I have a main report and a sub report. I have a formula field on the main report and one on the sub report. I want the formula in the subreport to be...
0
by: rjn | last post by:
Hi I have a main report in which I have inserted a sub report. I have a formula field on the main report and one on the sub report. I want the formula in the subreport to be evaluated after the...
3
by: Mike | last post by:
Hi, I have three tables in the following structure (simplified): Table 1: Containing the customers ------------------------------------------------- create table Customers ( int...
11
by: Brian VanPelt | last post by:
I am not a very experienced VB user, but I was trying to make a form that a user could input a formula for summation. For example, I would like the user to input the beginning and end values of...
1
by: barnzee | last post by:
Hi all, newbie here, but having a go I am trying to build a stock watchlist in excel 2007 with a dynamic link to a DDE server (paid for from a broker).There is no add-in or plug-in, I just CTL ALT...
30
by: Barry L. Bond | last post by:
Greetings! I just got a new Peet Brothers Ultimeter 2100 Weather Station. This new one has a way to display the heat index, if you press the "dew point" key twice. Being aware of all the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.