+ Reply to Thread
Results 1 to 4 of 4

Prevent a DIV/0 in an averaging formula

  1. #1
    Registered User
    Join Date
    06-28-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    11

    Prevent a DIV/0 in an averaging formula

    Good day,

    Here is the formula I am working with that is returning a DIV/0 value when there is no data to currently average. I would like it to return a 0 value.

    =AVERAGEIF('[2013 Pac West Master Tracker 1-1-13 - v8.2.xlsb]PAC West'!$A$14:$A$5636,"Z2",'[2013 Pac West Master Tracker 1-1-13 - v8.2.xlsb]PAC West'!$BU$14:$BU$5636)

    If the target range has a value I get a correct response, if it does not have a value I get DIV/0. I need the response to be a 0 if the target range has no values.

    I hope made myself clear.

    Thanks,

    DHBarkley

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Prevent a DIV/0 in an averaging formula

    Wrap in IFERROR

    =IFERROR(AVERAGEIF('[2013 Pac West Master Tracker 1-1-13 - v8.2.xlsb]PAC West'!$A$14:$A$5636,"Z2",'[2013 Pac West Master Tracker 1-1-13 - v8.2.xlsb]PAC West'!$BU$14:$BU$5636),0)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    06-27-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Prevent a DIV/0 in an averaging formula

    you will want to add another if function.
    =if('[2013 Pac West Master Tracker 1-1-13 - v8.2.xlsb]PAC West'!$A$14:$A$5636>=0,AVERAGEIF('[2013 Pac West Master Tracker 1-1-13 - v8.2.xlsb]PAC West'!$A$14:$A$5636,"Z2",'[2013 Pac West Master Tracker 1-1-13 - v8.2.xlsb]PAC West'!$BU$14:$BU$5636),0)

    try this and see if it will work. In theory, if the range has a value of 0 or higher, then it should run the averageif function. If it doesn't, then it should come up with a 0.

  4. #4
    Registered User
    Join Date
    06-28-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Prevent a DIV/0 in an averaging formula

    Thank you Ace, that correct the problem.

+ 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