+ Reply to Thread
Results 1 to 5 of 5

Average using 2 > and < criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    06-26-2008
    Location
    Okehampton UK
    MS-Off Ver
    Pro Plus 2019
    Posts
    12

    Average using 2 > and < criteria

    Hi Excel Gods

    I have 2 formulae that work just fine
    =AVERAGEIF($D$5:$D$340,">=150000")
    =AVERAGEIF($D$5:$D$340,"<50000")

    How do I get one to show the average of the values of the instances in between, ie <150000 AND >=50000?

    =AVERAGEIF($D$5:$D$340,"<150000",$D$5:$D$340)*AND(AVERAGEIF($D$5:$D$340,">=50000",$D$5:$D$340)) returns an incorrect value
    as does =SUMIF(D$5:D$340,"<150000")-(SUMIF(D$5:D$340,">=50000")))/(COUNTIF(D$5:D$340,"<150000")-COUNTIF(D$5:D$340,">=50000"))

    What am I missing?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Average using 2 > and < criteria

    See the AVERAGEIFS function.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Average using 2 > and < criteria

    I think I see your errors....

    =averageif(1) * averageif(2) / 2
    //You're not taking the averages of the averages because you're not dividing their product by 2!
    //What is that AND() doing? It's going to force the value to 1 or 0?

    =( SUMIF(1) + SUMIF(2) ) / ( COUNTIF(1) + COUNTIF(2) )
    //As it stands the syntax is 1 + 2/(3+4) not (1+2) / (3+4)



    However, like shg pointed out, you can use AVERAGEIFS() to do all of that with one built-in function instead.
    Last edited by ben_hensel; 11-13-2013 at 12:46 PM.

  4. #4
    Registered User
    Join Date
    06-26-2008
    Location
    Okehampton UK
    MS-Off Ver
    Pro Plus 2019
    Posts
    12

    Re: Average using 2 > and < criteria

    I should have said "also" or "as well as" rather than "AND" which was only going to confuse matters when discussing Excel.
    I still can't get the SUMIF - COUNTIF way to work but AVERAGEIFS has solved it
    thanks both

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Average using 2 > and < criteria

    You're welcome.

+ 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] Average with More Than One Criteria
    By Hudas in forum Excel General
    Replies: 8
    Last Post: 04-06-2012, 02:47 PM
  2. Replies: 5
    Last Post: 05-05-2010, 10:32 AM
  3. Finding Average with 2 criteria.
    By Fos605 in forum Excel General
    Replies: 3
    Last Post: 03-10-2009, 01:41 PM
  4. Average with a criteria?
    By a94andwi in forum Excel General
    Replies: 3
    Last Post: 11-26-2007, 09:48 AM
  5. Average given criteria, HELP!
    By Nebbez in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2005, 03: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