+ Reply to Thread
Results 1 to 8 of 8

Formula isn't working when one of the cells has a zero value

Hybrid View

  1. #1
    Registered User
    Join Date
    06-01-2011
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    19

    Formula isn't working when one of the cells has a zero value

    Hi All,

    I have an excel forumla as follows:

    =(B24/((B30*12)/100000))+(B26/((B32*12)/100000))

    Sometimes the entires in either B24&B30 or B26&B32 will be zero and when that happens the forumla returns a result of #DIV/0!.

    How can I make it so when either part is 0 it ignores that part and just works out the other part?

    Many thanks
    Last edited by langham; 06-01-2011 at 06:59 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Formula Help?

    langham
    Welcome to the forum but,
    Please take a few minutes to read the forum rules, and then amend your thread title accordingly
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Formula Help?

    Hi,

    Please read the forum rules and amend your thread title accordingly.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Registered User
    Join Date
    06-01-2011
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    19

    Re: Formula isn't working when one of the cells has a zero value

    Apologies - amended now.

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Formula isn't working when one of the cells has a zero value

    You should only need to test the divisor so maybe:

    =IF(B30<>0,(B24/((B30*12)/100000)),0)+IF(B32<>0,(B26/((B32*12)/100000)),0)

    Dom
    Last edited by Domski; 06-01-2011 at 07:07 AM.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,304

    Re: Formula isn't working when one of the cells has a zero value

    See if this does it for you:

    =IF(B30=0,0,(B24/((B30*12)/100000)))+IF(B32=0,0,(B26/((B32*12)/100000)))


    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Registered User
    Join Date
    06-01-2011
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    19

    Re: Formula isn't working when one of the cells has a zero value

    Hi Dom/TMShucks - worked perfect thank you so much for your help.

    Cheers

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,304

    Re: Formula isn't working when one of the cells has a zero value

    You're welcome.

    If this answers your question, please mark the thread as solved. See my signature for details or the FAQ.

    Regards

+ Reply to Thread

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.6.0 RC 1