+ Reply to Thread
Results 1 to 4 of 4

Removing #Div/0! from AVERAGEIFS function

  1. #1
    Registered User
    Join Date
    06-14-2011
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    7

    Removing #Div/0! from AVERAGEIFS function

    I am averaging columns of data for subtotals, however some columns contain 0's, thus giving me the #Div/0!

    Just looking for the syntax in VBA to check my table at the end of my macro to replace the #Div/0!s with either 0's or - marks.


    Here is my averageifs code:

    "=AVERAGEIFS(R" & startrow & "C" & inty & ":R" & intx - 1 & "C" & inty & " , " & "R" & startrow & "C" & inty & ":R" & intx - 1 & "C" & inty & " , " & Chr(34) & ">0" & Chr(34) & ")"



    Thank you!!

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Removing #Div/0! from AVERAGEIFS function

    Try using IFERROR, i.e.

    Please Login or Register  to view this content.
    Audere est facere

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Removing #Div/0! from AVERAGEIFS function

    Try this...

    "=IFERROR(AVERAGEIFS(R" & startrow & "C" & inty & ":R" & intx - 1 & "C" & inty & " , " & "R" & startrow & "C" & inty & ":R" & intx - 1 & "C" & inty & " , " & Chr(34) & ">0" & Chr(34) & "),0)"

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    06-14-2011
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Removing #Div/0! from AVERAGEIFS function

    Thanks @daddylonglegs, it worked out perfectly
    Appreciate the help as well @Ron Coderre

+ 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