+ Reply to Thread
Results 1 to 9 of 9

AVERAGEIFS based on two criteria in one column

  1. #1
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    AVERAGEIFS based on two criteria in one column

    Hello,

    I Just want to average Column "Q:Q" for all Column J:J contains "VANILLA VOIP" and "VoIP Enterprise"

    I've use the below formula but return nothing.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: AVERAGEIFS based on two criteria in one column

    I think you're going to have to do

    =SUM(SUMIF(J:J,{"VANILLA VOIP","VoIP Enterprise"},Q:Q))/SUM(COUNTIF(J:J,{"VANILLA VOIP","VoIP Enterprise"}))

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: AVERAGEIFS based on two criteria in one column

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: AVERAGEIFS based on two criteria in one column

    Hi zbor, I've got an error "you've entered too many arguments for this function...."

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: AVERAGEIFS based on two criteria in one column

    Try removing the last argument/range from teh countif()...
    =(SUMIF(J:J,"VANILLA VOIP",Q:Q)+SUMIF(J:J,"VoIP Enterprise", Q:Q))/(COUNTIF(J:J,"VANILLA VOIP")+COUNTIF(J:J,"VoIP Enterprise"))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: AVERAGEIFS based on two criteria in one column

    Thanks Ford.

    But when I try to incorporate it to vba, it gives me this formula:

    Please Login or Register  to view this content.
    wherein my code is:

    Please Login or Register  to view this content.

  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: AVERAGEIFS based on two criteria in one column

    Use cells to hold the criteria:

    A1 = VANILLA VOIP
    A2 = VoIP Enterprise

    Then, this array formula**:

    =AVERAGE(IF(ISNUMBER(MATCH(J2:J100,A1:A2,0)),Q2:Q100))

    ** 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.

    You should avoid using entire columns as range references in array formulas. Use smaller specific ranges.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: AVERAGEIFS based on two criteria in one column

    Remove the R1C1
    Quote Originally Posted by siobeh View Post
    Thanks Ford.

    But when I try to incorporate it to vba, it gives me this formula:
    Please Login or Register  to view this content.
    And did you try the formula I posted? It does essentially the same thing..
    SUM(SUMIF(J:J,{"VANILLA VOIP","VoIP Enterprise"},Q:Q)) is a nice shortcut for SUMIF(J:J,"VANILLA VOIP",Q:Q)+SUMIF(J:J,"VoIP Enterprise", Q:Q)

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: AVERAGEIFS based on two criteria in one column

    But when I try to incorporate it to vba, it gives me this formula:
    Perhaps you should have mentioned that from the start?

    Agree with Jonmo, I was just resolving the formula offered by zbor

+ 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. [SOLVED] Averageifs with 5 criteria
    By sharknuts5 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-19-2015, 01:04 PM
  2. [SOLVED] Macro for AverageIFS, with multiple criteria in the same criteria range
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 05-24-2014, 01:13 AM
  3. [SOLVED] Using WEEKDAY() as a criteria in AVERAGEIFS()
    By carwashguy in forum Excel General
    Replies: 6
    Last Post: 09-25-2013, 02:57 PM
  4. AVERAGEIFS with no criteria
    By anteagles20 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-14-2013, 10:10 AM
  5. Averageifs with OR criteria
    By Subject_Name_Here in forum Excel General
    Replies: 5
    Last Post: 05-28-2012, 01:57 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