Closed Thread
Results 1 to 9 of 9

get average of column based on conditions

  1. #1
    Registered User
    Join Date
    12-11-2014
    Location
    Paris
    MS-Off Ver
    2003
    Posts
    3

    get average of column based on conditions

    Hi,

    I would like to calculate average of a column, based on condition.
    let's take an example (see screenshot)
    example US.png

    if SUM(adults + Children) >=5, i want to calculate average price of Hotel room.
    so in my example to calculate average of (2000 and 5321).

    How can i do that ?
    thx,

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: get average of column based on conditions

    I cannot see your picture. Please post a sample workbook with sample results mocked up manually. Thanks.

    Remember to desensitize the data.

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

    View Pic
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: get average of column based on conditions

    cross post @
    http://www.mrexcel.com/forum/excel-q...m-2-cells.html
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: get average of column based on conditions


  5. #5
    Registered User
    Join Date
    12-11-2014
    Location
    Paris
    MS-Off Ver
    2003
    Posts
    3

    Re: get average of column based on conditions

    Sorry guyz, but different forums so multiple chance to get answer.
    by the way, if there is more forums it's because people do not get answers for there questions on the same place...as nobody is registered everywhere...

  6. #6
    Registered User
    Join Date
    12-11-2014
    Location
    Paris
    MS-Off Ver
    2003
    Posts
    3

    Re: get average of column based on conditions

    Sorry JBeaucaire, but i can perfectly see thescreenshot so i do not know where is the problem with you

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: get average of column based on conditions

    =sumproduct(--(b2:b100+c2:c100>=5),a2:a100)/sumproduct(--(b2:b100+c2:c100>=5))

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: get average of column based on conditions


  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: get average of column based on conditions

    Quote Originally Posted by rafnews View Post
    Sorry guyz, but different forums so multiple chance to get answer.
    by the way, if there is more forums it's because people do not get answers for there questions on the same place...as nobody is registered everywhere...
    Actually, let me clear that up for you... same question on multiple forums means you will almost guaranteed to waste somebody's time on one of these forums. Obviously that's great for you and a total slap in the face to us, the helpers.

    This thread will be closed. Before you post again on our forum to get free assistance from our awesome helpers, please read the Forum Rules, the same ones we all abide for the good of all, as must you.

    Thanks.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Average based on conditions
    By rafuk73 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-02-2014, 01:50 AM
  2. [SOLVED] Quite Complex Average based on multiple conditions
    By ryanmanc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-22-2013, 05:59 AM
  3. How to Get the Average of a Range Based on 2 Conditions
    By justinprime in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2013, 04:19 PM
  4. Average based on multiple conditions
    By kostas in forum Excel General
    Replies: 1
    Last Post: 03-27-2010, 07:00 PM
  5. Replies: 1
    Last Post: 03-12-2009, 06: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