+ Reply to Thread
Results 1 to 9 of 9

[SOLVED] Averageifs returning #DIV/0 error

  1. #1
    Registered User
    Join Date
    07-14-2011
    Location
    na
    MS-Off Ver
    Excel 2010
    Posts
    20

    [SOLVED] Averageifs returning #DIV/0 error

    Hi,
    I have a formula that is looking to average percents of standard margins. The fields it looks up could possibly return "nothing" if that work cell is not being used that month.
    my issue is how to get around the DIV/0 issue.
    Another question- is there a "cleaner" method of doing this code, array perhaps?
    The formula is as follows:.
    Please Login or Register  to view this content.
    Thanks in advance for any help!
    Kevin
    Last edited by kbotta; 10-09-2014 at 08:40 AM. Reason: [solved]

  2. #2
    Registered User
    Join Date
    04-07-2014
    Location
    Port Talbot, Wales
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Averageifs returning #DIV/0 error

    There are a number of ways to remove the #DIV/0 issue. Possibly the easiest to to say =if(Sheet2!CZ=0,"",AVERAGE(AVERAGEIFS(Sheet2!CZ........, or perhaps =IFERROR(Sheet2!CZ,0,AVERAGE(AVERAGEIFS(Sheet2!CZ......)
    Cobwebs, Alba Gu Brath (Scotland Forever)

  3. #3
    Registered User
    Join Date
    07-14-2011
    Location
    na
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Averageifs returning #DIV/0 error

    I am getting a Name? error.
    not sure about that one.
    Does this look right?
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-07-2014
    Location
    Port Talbot, Wales
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Averageifs returning #DIV/0 error

    Without seeing the actual file to understand exactly which cells you're referencing, it's hard to say. Unfortunately I'm about to set off on a long journey so can't help any further, but please post at least a sample file...there are many good and helpful souls here that will help...good luck

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

    Re: Averageifs returning #DIV/0 error

    If your profile is correct and you are using Excel 2003 then you won't be able to use AVERAGEIFS or IFERROR as these were only introduced in Excel 2007.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    07-14-2011
    Location
    na
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Averageifs returning #DIV/0 error

    Here is an example E11 is highlighted in red with the problem code. The two cells below E11 work with the code as there is data for those values.
    Regards- please help
    Kevin
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-14-2011
    Location
    na
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Averageifs returning #DIV/0 error

    Quote Originally Posted by Pete_UK View Post
    If your profile is correct and you are using Excel 2003 then you won't be able to use AVERAGEIFS or IFERROR as these were only introduced in Excel 2007.

    Hope this helps.

    Pete
    Sorry- very old profile not updated. Using 2010.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Averageifs returning #DIV/0 error

    Hello Kevin,

    I'm not sure your formula does what you intend it to do. Firstly the AVERAGE function at the start is redundant because it's only averaging a single value, you can take that out and get the same result.

    ....also you are effectively "averaging averages" which isn't usually a good idea, by adding all the AVERAGEIFS functions and dividing by 11 you are effectively giving the same "weight" to 100 instances of PG2 as one instance of PG5. If you want an average of column CZ when column D = "2014/10" and column A = any of the other 11 listed values then this formula will do that (and you shouldn't have any problems with #DIV/0! errors)

    =IFERROR(SUM(SUMIFS(Sheet2!CZ:CZ,Sheet2!D:D,"2014/10",Sheet2!A:A,{"PG2","PG5","PG7","PG9","assy","osp","#N/A","o/s","0","csp","PG2/PG5"}))/SUM(COUNTIFS(Sheet2!D:D,"2014/10",Sheet2!A:A,{"PG2","PG5","PG7","PG9","assy","osp","#N/A","o/s","0","csp","PG2/PG5"})),0)
    Last edited by daddylonglegs; 10-09-2014 at 08:37 AM.
    Audere est facere

  9. #9
    Registered User
    Join Date
    07-14-2011
    Location
    na
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Averageifs returning #DIV/0 error

    AWESOME! Exactly what I was looking for! Thanks a million!

    Quote Originally Posted by daddylonglegs View Post
    Hello Kevin,

    I'm not sure your formula does what you intend it to do. Firstly the AVERAGE function at the start is redundant because it's only averaging a single value, you can take that out and get the same result.

    ....also you are effectively "averaging averages" which isn't usually a good idea, by adding all the AVERAGEIFS functions and dividing by 11 you are effectively giving the same "weight" to 100 instances of PG2 as one instance of PG5. If you want an average of column CZ when column D = "2014/10" and column A = any of the other 11 listed values then this formula will do that (and you shouldn't have any problems with #DIV/0! errors)

    =IFERROR(SUM(SUMIFS(Sheet2!CZ:CZ,Sheet2!D:D,"2014/10",Sheet2!A:A,{"PG2","PG5","PG7","PG9","assy","osp","#N/A","o/s","0","csp","PG2/PG5"}))/SUM(COUNTIFS(Sheet2!D:D,"2014/10",Sheet2!A:A,{"PG2","PG5","PG7","PG9","assy","osp","#N/A","o/s","0","csp","PG2/PG5"})),0)

+ 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. Averageifs(offset(),..) error help
    By mariosmk555 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-05-2014, 01:35 PM
  2. [SOLVED] Averageifs returning DIV/0 errors even though there are values
    By lifeseeker1019 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2013, 02:19 AM
  3. DIV/0 error with AVERAGEIFS
    By pcp2010 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-13-2013, 10:01 AM
  4. AverageIFS with Div/0 error
    By Nemoren in forum Excel General
    Replies: 13
    Last Post: 05-03-2012, 09:33 AM
  5. Averageifs returning Value?
    By katja328 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-08-2009, 06:20 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