+ Reply to Thread
Results 1 to 13 of 13

Formula to Count Years Above Zero

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Formula to Count Years Above Zero

    I'm calculating the future value of annuities with several variables, so the FV function isn't an option.

    This formula gives me the expected value at the end of the term:

    =H6*((1+$G$1)^C6)-$I6*(((1+$G$1)^C6)-1)/$G$1)

    In this formula, C6 is the number of years. The math works when the number stays positive, but when it goes negative I need to change the formula.

    So for those that go below zero, I need to know at what point it crosses zero. In other words, I need to count the years above zero using the above formula.


    Is this even possible?
    Last edited by phelbin; 08-26-2016 at 12:13 PM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to Count Years Above Zero

    Please attach a sample file using non-confidential (but realistic) data to illustrate your problem.

    It would help if you include some examples where your formula does, and where it doesn't work, with the expected result entered manually for the latter examples.

  3. #3
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Re: Formula to Count Years Above Zero

    Great idea!

    I've attached a sample file that shows my problem.

    The variables are all on the left, and a yearly schedule is on the right. The important thing is the values in the yellow box. This equation works perfectly as long as the annuity stays positive. The equation for Annuity 1 matches the last value in the yearly schedule. But once Annuity 2 goes negative, then the math has to change. The final amount in the yearly schedule is correct, the value in the yellow box is not.

    I have far too many of these to maintain yearly schedules for each account and have them update automatically as each year goes by. So that's why I need to somehow calculate the expected value until it reaches zero and then switch to a new formula.

    Please let me know if that doesn't make sense.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to Count Years Above Zero

    Finance formulas are not something that I understand well, so it is possible that there could be a simpler way, but this does work.

    Array formula...

    PHP Code: 
    =FV($D$6,MIN(MATCH(0,FV($D$6,ROW(INDIRECT("1:"&$D$4)),D13,-D9),-1)+1,$D$4),D13,-D9)-(($D$4-MIN(MATCH(0,FV($D$6,ROW(INDIRECT("1:"&$D$4)),D13,-D9),-1)+1,$D$4))*D13
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  5. #5
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Re: Formula to Count Years Above Zero

    Jason, I'm in awe! That formula is a work of art. Thanks so much!!

  6. #6
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Re: Formula to Count Years Above Zero

    The formula works perfectly in my example workbook, but as soon as I add it to my actual workbook I get a #REF! error. Yes, I pushed Shift, Control, Enter.

    I had excel evaluate the formula, and it specifically doesn't like the INDIRECT("1:"&$C$4)).

    I've copied the formula directly into the workbook. I've tried replacing each of the values. I moved things around. I just can't get it to work in this one workbook.

    Any ideas?

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to Count Years Above Zero

    What is in C4?

    That part of the formula generates an array to evaluate the expected value for each period in the life of the annuity, so the content of C4 must be valid for that purpose.

    It can't cope with partial periods thought, the number in C4 must be a whole number.

    If you need partial periods, then we will need to re-evaluate the process.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to Count Years Above Zero

    Just a guess:

    F17 =MATCH(0,I5:I19,-1) result 15 (15 years)

    F18 =MATCH(0,J5:J19,-1) result 8 (8 years)
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to Count Years Above Zero

    Quote Originally Posted by oeldere View Post
    Just a guess:
    So now we have to guess the point you are trying to make?

    An observation is useless without information.

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to Count Years Above Zero

    @jason.b75

    Please Login or Register  to view this content.
    Maybe the OP wants to know when the value goes below zero (in which year).

    My formula will do that (and for Annuity 2 that is 8 years).

  11. #11
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to Count Years Above Zero

    Quote Originally Posted by oeldere View Post
    Maybe the OP wants to know when the value goes below zero (in which year).
    Maybe if you read the question, you would see that they actually want a formula to correctly calculate the Future Value without needing the table to calculate each year individually.

    edit:-

    Note the part in bold text, post #3 tells us that the purpose of the question is to eliminate the use of the extra table (which your formula relies on)!
    Last edited by jason.b75; 08-29-2016 at 02:24 PM.

  12. #12
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula to Count Years Above Zero

    Quote Originally Posted by oeldere View Post
    My formula will do that (and for Annuity 2 that is 8 years).
    And it is actually 9 years, the 8th year value is still positive.

  13. #13
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Re: Formula to Count Years Above Zero

    Jason, that's exactly what it was. Once I rounded the life expectancies, everything works just fine. Thanks!!


    Oeldere, I see that you're calculating the point of zero. My issue is that I needed a self contained formula for a larger table, since I won't be able to maintain yearly information as I did in the example workbook.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Retention formula to count unique customers that made a purchase in both years
    By stu40 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-23-2016, 01:24 AM
  2. Count yes/no in years with dates given
    By tonilony in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-20-2015, 06:22 PM
  3. [SOLVED] Excel formula years service between years
    By vba1234 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 11-25-2015, 04:19 PM
  4. [SOLVED] Using COUNT(IF(... to count number of months in years
    By Abid123 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-17-2014, 11:21 AM
  5. [SOLVED] Age based on DOB; Accounts for leap years. Years old if >2, Months if <2 years old.
    By sharpmel in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-17-2013, 04:20 PM
  6. [SOLVED] Count future years
    By Ltat42a in forum Excel General
    Replies: 2
    Last Post: 07-22-2012, 12:14 PM
  7. [SOLVED] Count Years Between Two Dates
    By sgwilliams in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2011, 09:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1