Avatar of Bright01
Bright01
Flag for United States of America asked on

Modification to ROI Formulas

EE Professionals,

I have a very nifty macro that DMille wrote for me that allows you to put in a "Time Horizon", as a number of months and it auto generates the date fields and copies the monthly calculation formulas into each litigimate month.  This is used to allow someone to determine how many months are to be included in a financial analysis to calculate NPV, IRR and BEP.   Here's the challenge. The formulas for NPV and IRR need to be reconfigured to automatically adapt to the number of months selected in the Time Horizon (since it is now dynamic).

Attached is the WS.  The formulas that need modification are in AF3 and AF4 (right now they are fixed at 36 months).

Thank you in advance,

B.
Workbench-v26.xlsm
Microsoft Excel

Avatar of undefined
Last Comment
dlmille

8/22/2022 - Mon
dlmille

I suppose I already did this for you in this workbook, on a related question. NVP, IRR, and BEP along with the chart are all dynamic ;)

See attached.

Dave
Workbench-v27-r2.xlsm
Bright01

ASKER
Dave,

It's a little more complex........... The dynamic Time Horizon that you created works great. However, the formula modification that is required to adapt to the new, dynamic Horizon, that is set, is in cell AF3, AF4 and AF5:  

SAMPLE OF THE FORMULA IN AF3:

=IF(AA3=0,"",(NPV((1+AC3+AD3)^(1/12)-1,AI3:BR3)+AH3))

The mod. needs to be changing the end point or last month in the new Time Horizon, which is currently static "BR3"  (I had to set it up for 36 months).  When you set up the dynamic Months, the Months can change but I don't know how to get the formula, specifically BR3 (the end point) to automatically reflect the new, dynamic range.

EXAMPLE:

If I change the Time Horizon to 6 months, BR3 in the formula should be AN3.  If I change the Time Horizon to 12 months, BR3 in the formula should actually reflect AT3.  Only at 36 months in the Time Horizon, where your code fires and it gives me the 36 months correctly, is the formula actually correct as BR3.

Make sense?  Easy fix?

B.
ASKER CERTIFIED SOLUTION
dlmille

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Bright01

ASKER
Dave,

Before I test and integrate;  does this work both for the "new scenarios" (replicas of "Scenario_Template") as well as the "new use cases" - (replicas of use cases within new scenarios)?

B.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
dlmille

Yes - but it won't work with scenarios that were created BEFORE this range name was added.

I tested it after having created it in the Scenario_Template tab, then made a copy of the Scenario_Template tab to create Scenario1.  I then added Use Cases and tested that.

Works fine from my end.

Dave
Bright01

ASKER
Brilliant!  

So just as I integrate this..... is the FinOffSet that is created in the Named Range File automatically generated for the Scenario1 Tab, or do I have to put that in as a Named Range addition?

B.
dlmille

Nope.  As long as the name exists in the Scenario_Template tab, then when you create new scenarios, it will get replicated to the new tab for use, there.

Dave
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
dlmille

I tried it at the WORKBOOK level scope, and it didn't work the way I'd imagined, so these names are at the Worksheet level, so they get created in Scenario_Template.  When a new scenario is generated, then the new range names are created on the new Scenario# sheet as well.

Dave
Bright01

ASKER
So I don't need to replicate the FinOffSet for Scenario1; just the Scenario_Template....

Got it.

B.
Bright01

ASKER
Great Work Dave.....tough formula.  Testing it going forward; but integrated well.

Thanks again,

B.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Bright01

ASKER
Dave,

When I replicate a use case, I get Excel asking me if I want to use the FinOffset and BEPOffset each time I add one.  Is there a line of code that makes that automatic?

Thank you,

B.
dlmille

Add

Application.DisplayAlerts = False

Before the routine that replicates scenario template does the copy
Bright01

ASKER
Dave,

Thank you!  Works.   Hey Big Congrats on your point standing!  I don't know what you guys win for your work but it should be great.

B.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
dlmille

Tks

It's just points so mostly recognition or ego

Tshirts at certain milestones and if you lead for the year some trophy or something

I do it for the learning, community service, comradre, and I guess recognition in that order

I've learned so much it's really made my job easier at work and my first passion/career was in IT and my hope is to retire with capability so I can earn a few and have fun at the same time

Dave
Bright01

ASKER
Well, I would invite you to come visit the East Coast and the Mountains of NC whenever you want and I'll put you and family up.  Within a couple of years of retirement myself.......and really enjoy EE and the personalities.

B.
dlmille

I'm headed to a meeting in Cambridge in June

About the closest but maybe DC in the Fall
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23