+ Reply to Thread
Results 1 to 6 of 6

#DIV/0 Error

  1. #1
    Registered User
    Join Date
    06-23-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    7

    #DIV/0 Error

    I'm trying to get rid of the DIV/0 error that keeps popping up with this formula:

    =(SUMIF(B2:B26,"YES",C2:C26))/((COUNTA(C2:C26)))

    I've tried to add the ISERROR function and a couple other functions but I haven't had any luck. Anyone have any suggestions?
    Last edited by Finn; 06-23-2009 at 02:10 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: #DIV/0 Error

    Try

    =IF(COUNTA(C2:C26),(SUMIF(B2:B26,"YES",C2:C26))/COUNTA(C2:C26),0)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-23-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: #DIV/0 Error

    Okay that works but the cells that do not have YES in them are being checked and it is making the answer incorrect.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: #DIV/0 Error

    Try then:

    =AVERAGE(IF(B2:B26="YES",IF(C2:C26<>0,C2:C6)))

    confirmed with CTRL+SHIFT+ENTER not just ENTER

  5. #5
    Registered User
    Join Date
    06-23-2009
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: #DIV/0 Error

    That helps it prevents the non-"YES" fields from being used but now still returns a #DIV/0 error when the C2:C26 fields are 0

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: #DIV/0 Error

    Then perhaps:

    =IF(SUM(C2:C26),AVERAGE(IF(B2:B26="YES",IF(C2:C26<>0,C2:C26))),0)

    confirmed with CTRL+SHIFT+ENTER

+ 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