+ Reply to Thread
Results 1 to 7 of 7

Combine SUBTOTAL and AVERAGEIF?

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Combine SUBTOTAL and AVERAGEIF?

    Can anyone tell me how I could combine these two functions?

    =SUBTOTAL(1,A1:A10O) and AVERAGEIF(A1:A100,">0")

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combine SUBTOTAL and AVERAGEIF?

    Try this array formula**:

    =AVERAGE(IF(SUBTOTAL(9,OFFSET(A3,ROW(A3:A100)-ROW(A3),0,1))>0,A3:A100))

    ** 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.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Combine SUBTOTAL and AVERAGEIF?

    Tony,

    I used this formula for the actual range with which I am working: {=AVERAGE(IF(SUBTOTAL(9,OFFSET(D9,ROW(D9:D209)-ROW(D9),0,1))>0,D9:D209))}

    It appears to be working correctly. Does the formula look correct to you? I wasn't sure why you OFFSET by a couple of rows in your formula is why I ask.

    CUFF
    Last edited by CUFF; 01-27-2014 at 09:08 PM.

  4. #4
    Registered User
    Join Date
    01-27-2014
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Combine SUBTOTAL and AVERAGEIF?

    Tony,

    I used this formula for the actual range with which I am working: {=AVERAGE(IF(SUBTOTAL(9,OFFSET(D9,ROW(D9:D209)-ROW(D9),0,1))>0,D9:D209))}

    It appears to be working correctly. Does the formula look correct to you? I wasn't sure why you OFFSET by a couple of rows in your formula is why I ask.

    CUFF

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combine SUBTOTAL and AVERAGEIF?

    Yes, that's the correct syntax.

    We need to use OFFSET so that we get an individual subtotal for each cell in the referenced range.

  6. #6
    Registered User
    Join Date
    01-27-2014
    Location
    Birmingham, Alabama, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Combine SUBTOTAL and AVERAGEIF?

    Excellent and thank you; I understand this all so much better now!

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combine SUBTOTAL and AVERAGEIF?

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Combine SUBTOTAL and AVERAGEIF
    By CUFF in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-27-2014, 08:06 PM
  2. How to combine Subtotal, Sumifs and more
    By Tipler93 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-23-2014, 12:12 PM
  3. Combine Subtotal and Sumif
    By Rompetelo in forum Excel General
    Replies: 4
    Last Post: 12-12-2012, 09:20 AM
  4. How to combine SUBTOTAL function with ABS
    By efernandes67 in forum Excel General
    Replies: 3
    Last Post: 11-30-2007, 03:45 PM
  5. Combine Subtotal Macro
    By Harlequin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-04-2007, 12:13 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