+ Reply to Thread
Results 1 to 8 of 8

Avoiding 0 or #Div/0

  1. #1
    Registered User
    Join Date
    09-21-2012
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Avoiding 0 or #Div/0

    I need to avoid including empty cells or ones containing #Div/0 to calculate an average of a column that will not always be full. i.e

    A1-8
    A2-7
    A3-1
    A4-1
    A5-0 or Div 0
    A6-0 or Div 0
    A7-0 or Div 0
    A8-0 or Div 0

    In any scenario i only want to Average the values of the cells which containing inputs (A1-A4 in this case) but cells A5-A8 must remain just not be counted. i presume it is an IF Formula but im being unsuccessful in producing one so, if anyone could write me the correct formula for what cell A9 should contain to produce an average without DIV 0 appearing

    Thanks

    Stu
    Last edited by Stu.martin01; 09-27-2012 at 09:23 AM. Reason: incorrect content

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Avoiding 0 or #Div/0

    Try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Avoiding 0 or #Div/0

    Hi - If the values in cells A1:A8 are coming from a formula you can easily modify the formula to display "NA" instead of 0 or Div / 0 errors. By doing so, the average wont get impacted in cell A9 as typically the Average function does not take "NA"'s into consideration.

    Thxs.

    Quote Originally Posted by Stu.martin01 View Post
    I need to avoid including empty cells or ones containing #Div/0 to calculate an average of a column that will not always be full. i.e

    A1-8
    A2-7
    A3-1
    A4-1
    A5-0 or Div 0
    A6-0 or Div 0
    A7-0 or Div 0
    A8-0 or Div 0

    In any scenario i only want to Average the values of the cells which containing inputs (A1-A4 in this case) but cells A5-A8 must remain just not be counted. i presume it is an IF Formula but im being unsuccessful in producing one so, if anyone could write me the correct formula for what cell A9 should contain to produce an average without DIV 0 appearing

    Thanks

    Stu

  4. #4
    Registered User
    Join Date
    09-21-2012
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Avoiding 0 or #Div/0

    How do i modify the formula to display NA instead of DIV 0?

    Thanks
    Stu

  5. #5
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Avoiding 0 or #Div/0

    Change the existing formula in cell A1 to:

    =if(iserror(YOUR EXISTING FORMULA),"NA",YOUR EXISTING FORMULA)

    Repeat this for all cells down to A8. If you do this right, the average in A9 would be what you were looking for.

    Thanks,

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Avoiding 0 or #Div/0

    IFERROR, as you use Eexcel 2007. =iferror(YOUR EXISTING FORMULA),"NA")

    But why not AVERAGEIG, as suggested Or AVERAGEIFS?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

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

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  7. #7
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Avoiding 0 or #Div/0

    Not sure that we will be able to eliminate "#Div/0!" errors appearing in any of the cells between A1:A8 by using AverageIF function.

    Though i see that 0's could be eliminated from the ranges by using that...

    Thanks,
    K B

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Avoiding 0 or #Div/0

    Quote Originally Posted by kbkumar View Post
    Not sure that we will be able to eliminate "#Div/0!" errors appearing in any of the cells between A1:A8 by using AverageIF function.

    Though i see that 0's could be eliminated from the ranges by using that...

    Thanks,
    K B
    Perhaps you could do the effort to try it out?

    Also read post #6 to learn XL 2010 / 2007 possibilities?
    Last edited by Pepe Le Mokko; 09-27-2012 at 12:48 PM.

+ 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