Consulting

Results 1 to 3 of 3

Thread: How to Show Blank Cell Instead Of #DIV/0!

  1. #1

    How to Show Blank Cell Instead Of #DIV/0!

    Morning All,

    I am using a simple divide forumla (E5/F5) in cell (H5) to return an average. Is there anyway that if the contents of E5 and F5 are zero that a blank cell or zero can be returned instead of DIV/0!.

    Regards,

    Matt

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    =IF(ISERROR(E5/F5),"",E5/F5)
    or to give you exactly waht you asked for:
    =IF(OR(E5=0,F5=0),"",E5/F5)
    Note that only a zero/blank in F5 will give a #DIV/0 error, a 0 in E5 will not.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    Use =IF(Error.Type(E5/F5)=2,"",E5/F5)

    Note the use of the Error.Type function within the formula. By using this, you are checking for errors causing the Divide by Zero, rather than just masking all errors when using ISError.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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