+ Reply to Thread
Results 1 to 5 of 5

Getting the #DIV/0! Error but I want to divide by 0

  1. #1
    Forum Contributor
    Join Date
    06-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    136

    Getting the #DIV/0! Error but I want to divide by 0

    Hello,

    I have a feeling this is really simple but I cannot get it to work and I am running out of time to get people paid bonuses!

    I have attached the spreadsheet I am working with.

    In Rows 2-6 I have formulas entered to compute if someone hit their bonus goals. It returns a Y or a N. In some cases though I have it returning blank because that didn't apply to that property. Then in Column G I want it to take the total Y responses divided by the total cells that returned a response and times that by the total bonus % possible. So in my attached example (Tab EOM-HOM-611-GB) Row 5 I get the desired result. But when I have all Y or all N I am getting the error. G4 Should return 0 and and G3 should return 10.

    Any help is greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,960

    Re: Getting the #DIV/0! Error but I want to divide by 0

    Maybe this:
    =F2*(COUNTIF(B2:E2, "Y")/SUM(COUNTIF(B2:E2,{"Y","N"})))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    08-12-2020
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office 16
    Posts
    241

    Re: Getting the #DIV/0! Error but I want to divide by 0

    Hi heresteve2,
    You said, " divided by the total cells that returned a response" but your formulas are dividing by the number (Countblank) that do not return a response. In Row 2 there are zero cells that did not return a response and since you cannot mathematically divide by zero you get the error.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,685

    Re: Getting the #DIV/0! Error but I want to divide by 0

    Try this formula in G2:

    =(COUNTIF(B2:E2, "Y")/COUNTA(B2:E2))*F2

    then copy down to G6. Change the formula in G7 to this:

    =SUM(G2:G6)/100

    Hope this helps.

    Pete

  5. #5
    Forum Contributor
    Join Date
    06-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    136

    Re: Getting the #DIV/0! Error but I want to divide by 0

    Hi Glenn,

    This seemed to do the trick. Thank you so much!

+ 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] Divide by 0 error 13
    By Dalton626 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2013, 05:28 PM
  2. Divide by zero error again!
    By AllenMead in forum Excel General
    Replies: 4
    Last Post: 10-31-2010, 04:00 PM
  3. Divide by Zero Error
    By AllenMead in forum Excel General
    Replies: 5
    Last Post: 09-22-2010, 08:36 AM
  4. Divide by zero error
    By dale.harrison in forum Excel General
    Replies: 1
    Last Post: 10-02-2009, 09:27 AM
  5. divide by zero error...
    By doublejoy in forum Excel General
    Replies: 12
    Last Post: 08-22-2009, 06:16 PM
  6. divide zero by zero and not get an error??
    By lc130 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-10-2007, 09:32 PM
  7. divide by zero error
    By schlicken in forum Excel General
    Replies: 2
    Last Post: 05-23-2007, 04:17 PM
  8. Divide by zero error
    By gregmosu in forum Excel General
    Replies: 1
    Last Post: 06-30-2006, 12:10 PM

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