Closed Thread
Results 1 to 6 of 6

Thread: Zero value

  1. #1
    Registered User
    Join Date
    02-04-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Zero value

    Hi guys

    I can not solve a problem I currently have using the following formula in excel 2003,
    =IF(E73<2,B15*0.02+55,IF(E73<3,B15*0.024+60,IF(E73<4,B15*0.03+65,IF(E73<5,B15*0.036+70,IF(E73<6,B15* 0.042+75,IF(E73<7,B15*0.05+80,IF(E73<8,B15*0.061+85,IF(E73<9,B15*0.071+90))))))))
    It works perfect except for when cell E73 has a zero balance. When a zero balance is in cell E73 I need a zero in the target cell which is cell K73. I have tried several scenarios attached to the existing formula including IF & COUNTIF but can not seem to solve what appears such a simple problem. Any assistance would be greatly appreciated.

    Regards
    Mark

  2. #2
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Zero value

    Hi Mark,

    welcome to the forum.

    You've already maxed out the 7 nested IFs Excel 2003 tolerates, so there's not much more you can do hanging on to that structure. Nested IFs can often be replaced by something more versatile. Like this:

    =IF(B15=0,0,B15*LOOKUP(E73,{1,2,3,4,5,6,7,8},{0.02,0.024,0.03,0.036,0.042,0.05,0.061,0.071})+LOOKUP( E73,{1,2,3,4,5,6,7,8},{55,60,65,70,75,80,85,90}))

    Instead of hardcoding the Lookup arrays into the formula, you could also enter them in a part of your sheet and refer Lookup to those ranges.

    does that make sense?
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  3. #3
    Registered User
    Join Date
    02-04-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Zero value

    Hi Teylyn,

    Thanks for the reply, now I understand why when I added an additional IF scenario it highlite the last IF. I have tried the formula suggested which works except it returns a #N/A instead of a 0 within the target cell. I have never had this before so I assume it is associated with LOOKUP. Once again, thanks for your input as it explained to me part of what I was doing wrong(too many IF's).

    Regards
    Mark

  4. #4
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Zero value

    Ah, sorry, my bad. The formula has to start with

    =IF(E73=0,0,B15*LOOKUP(E73,{1 ....
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  5. #5
    Registered User
    Join Date
    02-04-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Zero value

    Teylyn,
    Thanks for that, works grouse now.
    Regards
    Mark

  6. #6
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140

    Re: Zero value

    Michael, please take a moment to read the rules and then post your question in a new thread in accordance with rule #2. Thanks.

Thread Information

Users Browsing this Thread

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

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.2.0