Hi,
I am trying to calculate NPV on a range of values that may change. I am attaching an excel file that i think explains it the easiest.
Thanks!
NPV with dynamic range.xlsx
Hi,
I am trying to calculate NPV on a range of values that may change. I am attaching an excel file that i think explains it the easiest.
Thanks!
NPV with dynamic range.xlsx
i think i got it. Does this make sense?
=NPV(0.05,INDEX(B2:K2,MATCH(A1,B1:K1)):K2)
Hi,
See attached,
I have assumed that when you say 'After the year in A1' you mean starting with the next year. So if 2018 is in A1 the NPV is for years 2019-2024
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Thanks Richard. Based on my statement "after the year in A1" your answer is spot on. Thanks! However, I think it may be easier to just assume that the year in A1 is the first year "discounted." The solution I came up with seems to work. See my updated attachment. Thoughts? Thanks again!!!NPV with dynamic range.xlsx
Yes, your method is perfectly OK and indeed better than mine since it's shorter - always a good thing.![]()
i ran into a problem. using the formula in the attachment I provided (post 4), if i delete a column (say I don't need column K) or I need to add columns the formula does not adjust. Am i missing something or is this limitation of my syntax????
Last edited by duvius; 05-29-2015 at 09:57 AM.
Hi,
With the column delete I'm not sure what you mean by the the formula doesn't adjust. Take the column B formula
=NPV(0.05,B2:K2)
deleting column K, or indeed any of the other columns changes the formula to
=NPV(0.05,B2:J2)
Similarly if you were to Add a column before column K the formulae would adjust to reflect the larger range, i.e. column B formula would be
=NPV(0.05,B2:L2)
The only case where the formula wouldn't adjust would be adding a column after column K.
You can get round this by changing the B3 formula to
=NPV(0.05,OFFSET(B2,0,0,1,COUNTA(2:2)))
and copying this across.
I think if you go into this file you will see what I am talking about. if you delete K you get a #ref error. Also row 3 is mostly irrelevant. it was mainly to check formula in A2. The formula in A2 is the one that needs to adjust when a column is deleted (or added)
NPV with dynamic range.xlsx
Last edited by duvius; 05-29-2015 at 11:31 AM.
OK,
I thought you were talking about the row 3 formulae.
Use instead in A2
![]()
Please Login or Register to view this content.
okay thanks. that works in the prior attached example. However, when i tried to put it into my big model it didn't work. I tried to replicate what is going on in my model and I backed into the formula but I don't understand why it is working. Can you please help me understand? Mainly why the col adjustment of -7???
Last edited by duvius; 05-29-2015 at 12:36 PM.
NPV with dynamic range (2).xlsx
here is the revised attachment
Hi,
The -7 (or -2 in the original example) is necessary since your data starts in column 7.
The MATCH(C2,3:3) bit of the formula returns the column number for the year in question. i.e. column 11 (K) if 2019 is selected. Hence we need to deduct 7 to bring the OFFSET (third column parameter) back to a value of 4 meaning the Offset start point is G + 4 = column K
okay. i need to chew on this a little. I get most of it. Thanks so much!
HI Everyone, thank you for the solutions presented.
I have a question that I hope you can help me with (this is a variant of the problem statement original posted)
I have an excel file with each row representing different projects, each project starts at different periods (assume we want to measure NPV for 6 years each)...
I want a formula to do NPV for each project. But need to be able to do it in each row with different time frames (start and end date)
How would you set this up?
Thank you in advance
(Attached a file with the example)
@ExcelForumOG.... Fortunately, Excel NPV is toleratant of empty cells and even cells with text. They are ignored.
So you can enter =NPV(10%,E7:L7) into N7 and copy down the column with no changes.
As proof of concept, note that the results in column O, where each NPV is tailored to just the applicable cash flows, is the same as column N, per column P.
-----
Thank you - how would you avoid if people plug in zeroes, before the start of the project since zeroes will change the NPV.
Right, but only for zeros in the earlier periods.
And I wouldn't "avoid" it. Zeros in earlier periods have meaning, when used correctly. It means that "t0" (the year of present value) is before the first non-zero cash fllow. For example, you might want to compare the NPV to 2019 of Project 3 with delaying the project until 2021 (Project 1). In that case, we might want to account for the time-value of the delay.
So I guess I would "avoid" it by telling such people: GIGO! But if they insist on seeing meaningless zeros, tell them to enter it as text; e.g. ="0" or '0 (apostrophe zero). Again, Excel NPV ignores text as well as empty cells.
Of course, if you insist, we could complicate the NPV formula to ignore early zero periods. But that can be messy.
PS.... You are "responding" to a discussion that ended 7 years ago. I responded when I thought the question could be resolved quickly. If you continue to have follow-up questions, I think you should start a new discussion.
Last edited by curiouscat408; 07-09-2022 at 04:48 PM.
Thank you that was pretty helpful!
Administrative Note:
Welcome to the forum.
We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.
Please see Forum Rule #4 about hijacking and start a new thread for your query.
If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
My apologies, first time posting.
Thanks
This formula is great! I used it in a real estate deal I'm modeling and it worked perfectly. Was trying to understand how the index function works if you are not inputting a row number (Match seems to only reference the column.) Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks