+ Reply to Thread
Results 1 to 6 of 6

#div/0 or #value error

  1. #1
    Registered User
    Join Date
    10-02-2013
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2007
    Posts
    3

    #div/0 or #value error

    Hi All-
    I have a likely easy question, but I'm completely stumped. I have a worksheet that I'm trying to calculate the percentage of how many times "y" appears in a column (#y/total of y & n). If there is no data at all in the column, of course, I get a #div/0 error with this formula:

    =COUNTIF(Table3[JAN Target Bx % Achieved],"Y")/(SUM(COUNTIF(Table3[JAN Target Bx % Achieved],"Y"),COUNTIF(Table3[JAN Target Bx % Achieved],"N"))))

    It works as long as there is at least 1 "y" or "n" in the coulmn, but i get the error if no data has been entered. I tried correcting with this and keep getting a #value error:


    =IF(Table3[JAN Target Bx % Achieved]="","",COUNTIF(Table3[JAN Target Bx % Achieved],"Y")/(SUM(COUNTIF(Table3[JAN Target Bx % Achieved],"Y"),COUNTIF(Table3[JAN Target Bx % Achieved],"N"))))

    Any help would be greatly appreciated!
    Thank you in advance!

  2. #2
    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
    44,464

    Re: #div/0 or #value error

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    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


  3. #3
    Registered User
    Join Date
    10-02-2013
    Location
    New Mexico, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: #div/0 or #value error

    If you want to get rid of #value error, try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-02-2013
    Location
    Jackson, MS
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: #div/0 or #value error

    Thank you both so much! Your help is very much appreciated!

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: #div/0 or #value error

    FYI,

    You can simplify this part

    SUM(COUNTIF(Table3[JAN Target Bx % Achieved],"Y"),COUNTIF(Table3[JAN Target Bx % Achieved],"N"))
    to
    SUM(COUNTIF(Table3[JAN Target Bx % Achieved],{"Y","N"}))

    So the overall formula becomes
    =IFERROR(COUNTIF(Table3[JAN Target Bx % Achieved],"Y")/SUM(COUNTIF(Table3[JAN Target Bx % Achieved],{"Y","N"})),"")

  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
    44,464

    Re: #div/0 or #value error

    You're welcome.

+ 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] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  2. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  3. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  4. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  5. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02: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