+ Reply to Thread
Results 1 to 13 of 13

Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

  1. #1
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    I am trying to make a report and trying to use IFERROR, SUBTOTAL AND AVERAGEIF together but unable to use so
    Averageif because if there is Zero, it should be ignored and not added to the average
    Iferror so that I do not get ?NAME errror etc

    I am trying to use SUBTOTAL so that in case I hide the column because I do not want the data of the row in the calculations and hence in the result
    At present my formula which works, looks like this
    =IFERROR(AVERAGEIF(B13:P13,"<>0"),0)

    Please advice how do I incorporate SUBTOTAL function in the formula so that if I hide the entire column, the data is ignored.
    Am I going around in circles?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    Subtotal() will work with Hidden Rows only and not with (Hidden) column


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    Thank you very much for your reply, anything I can do for hidden columns?

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    Create your own UDF to take care of hidden columns

  5. #5
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    I changed the format from column to rows so that I can use subtotal

    Also tried using it =IFERROR(SUBTOTAL(109,(AVERAGEIF(D7:D21,"<>0"))),0)

    but I get error, I am not an expert, but find excel interesting

  6. #6
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    TRIED EVEN =IFERROR,SUBTOTAL(109,(AVERAGEIF(D7:D21,"<>0")), 0)
    I am not able to get it correct

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  8. #8
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    Quote Originally Posted by :) Sixthsense :) View Post
    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    The Sky blue cell are the focus,
    The cells above them can sometimes be blank or with "NO" in them so if the cells do not have number, it wont count it
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    updated file
    Attached Files Attached Files

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    In P27 Cell - Array Formula - Requires CTRL+SHIFT+ENTER


    =AVERAGE(IF(SUBTOTAL(109,OFFSET(P7,ROW(P7:P26)-ROW(P7),0,1))>0,P7:P26))


    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

  11. #11
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    Thank you for your help, there how ever seems to be one limit. that there has to be something filled in first row. If I put 0 in frist row, it does not work

  12. #12
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    using this

    =IFERROR(AVERAGE(IF(SUBTOTAL(109,OFFSET(P7,ROW(P7:P26)-ROW(P7),0,1))>0,P7:P26)),0)

  13. #13
    Registered User
    Join Date
    04-12-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    9

    Re: Using IFERROR, SUBTOTAL AND AVERAGE IF TOGETHER

    using this

    =IFERROR(AVERAGE(IF(SUBTOTAL(109,OFFSET(P7,ROW(P7:P26)-ROW(P7),0,1))>0,P7:P26)),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. How to have ISBLANK, IFERROR and Average together in formula.
    By taylorsm in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-02-2016, 06:43 AM
  2. Incorrect Average due to IfError formula
    By dreamer001 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-18-2016, 05:45 PM
  3. SUBTOTAL with AVERAGE IFS or AVERAGE IFS only for visible values
    By LANGORIER in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-14-2015, 01:08 PM
  4. Pivot: How to get the average of Subtotal
    By Siops in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 10-07-2013, 10:53 AM
  5. Replies: 5
    Last Post: 06-19-2012, 04:37 PM
  6. Subtotal Sum, and Subtotal Average on same row
    By ImpetuousRacer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2008, 05:41 PM
  7. Subtotal average
    By iain_clark in forum Excel General
    Replies: 7
    Last Post: 03-07-2007, 10:33 AM

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