+ Reply to Thread
Results 1 to 2 of 2

Average a group, where grouping is Conditional on other col.???

  1. #1
    Registered User
    Join Date
    06-09-2006
    Posts
    1

    Average a group, where grouping is Conditional on other col.???

    Ok, i have what is seemingly an easy problem but i just cant solve its simply

    I want to create averages of groupings of data, but the groupings are conditional on another column

    So if my smaple data is below:

    Please Login or Register  to view this content.
    I want to create THREE averages from the data in column B
    1) an average for all the data in colB where there is a corresponding 'x' in colA
    2) an average for all the data in colB where there is a corresponding 'y' in colA
    3) an average for all the data in colB where there is a corresponding 'z' in colA

    I cant seem to find an easy answer to this. Can anyone help?

  2. #2
    Guest

    Re: Average a group, where grouping is Conditional on other col.???

    Hi
    Try something like this:
    =SUMIF(A2:A10,"x",B2:B10)/COUNTIF(A2:A10,"x")
    Change the "x" as appropriate.

    Andy.

    "tommot82" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Ok, i have what is seemingly an easy problem but i just cant solve its
    > -simply-
    >
    > I want to create averages of groupings of data, but the groupings are
    > conditional on another column
    >
    > So if my smaple data is below:
    >
    >
    > Code:
    > --------------------
    >
    > col A col B
    > x 1
    > x 2
    > x 3
    > y 2
    > y 2
    > z 4
    > z 5
    > z 6
    > z 7
    >
    > --------------------
    >
    >
    > I want to create THREE averages from the data in column B
    > 1) an average for all the data in colB where there is a corresponding
    > 'x' in colA
    > 2) an average for all the data in colB where there is a corresponding
    > 'y' in colA
    > 3) an average for all the data in colB where there is a corresponding
    > 'z' in colA
    >
    > I cant seem to find an easy answer to this. Can anyone help?
    >
    >
    > --
    > tommot82
    > ------------------------------------------------------------------------
    > tommot82's Profile:
    > http://www.excelforum.com/member.php...o&userid=35252
    > View this thread: http://www.excelforum.com/showthread...hreadid=550258
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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