+ Reply to Thread
Results 1 to 5 of 5

Average depending on criteria

  1. #1
    dan
    Guest

    Average depending on criteria

    Hi, I have a table similiar to this on Sheet1:

    Col A ColB
    2 Dog
    5 Dog
    3 Cat
    8 Dog

    On Sheet2, I want to calculate the average of the values in ColA where
    ColB says Dog.

    So sheet 2 would be:
    Average
    Dog 5
    Cat 3


    How can i do this?

    Thank you!!


  2. #2
    news.comcast.net
    Guest

    Re: Average depending on criteria

    Try this:
    =AVERAGEIF(B1:B4,"=dog",A1:A4)
    Brian

    "dan" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, I have a table similiar to this on Sheet1:
    >
    > Col A ColB
    > 2 Dog
    > 5 Dog
    > 3 Cat
    > 8 Dog
    >
    > On Sheet2, I want to calculate the average of the values in ColA where
    > ColB says Dog.
    >
    > So sheet 2 would be:
    > Average
    > Dog 5
    > Cat 3
    >
    >
    > How can i do this?
    >
    > Thank you!!
    >




  3. #3
    Bobocat
    Guest

    Re: Average depending on criteria

    I use sumif/countif
    =SUMIF(B2:B5,"Dog",A2:A5)/COUNTIF(B2:B5,"Dog")
    =SUMIF(B2:B5,"Cat",A2:A5)/COUNTIF(B2:B5,"Cat")

    "dan" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, I have a table similiar to this on Sheet1:
    >
    > Col A ColB
    > 2 Dog
    > 5 Dog
    > 3 Cat
    > 8 Dog
    >
    > On Sheet2, I want to calculate the average of the values in ColA where
    > ColB says Dog.
    >
    > So sheet 2 would be:
    > Average
    > Dog 5
    > Cat 3
    >
    >
    > How can i do this?
    >
    > Thank you!!
    >




  4. #4
    Bob Phillips
    Guest

    Re: Average depending on criteria

    =AVERAGE(IF(Sheet1!a2:A200="Dog",Sheet1!A2:A200))

    which is an array formula, it should be committed with Ctrl-Shift-Enter, not
    just Enter.

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "dan" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, I have a table similiar to this on Sheet1:
    >
    > Col A ColB
    > 2 Dog
    > 5 Dog
    > 3 Cat
    > 8 Dog
    >
    > On Sheet2, I want to calculate the average of the values in ColA where
    > ColB says Dog.
    >
    > So sheet 2 would be:
    > Average
    > Dog 5
    > Cat 3
    >
    >
    > How can i do this?
    >
    > Thank you!!
    >




  5. #5
    Ron Rosenfeld
    Guest

    Re: Average depending on criteria

    On 7 Jul 2006 11:15:22 -0700, "dan" <[email protected]> wrote:

    >Hi, I have a table similiar to this on Sheet1:
    >
    >Col A ColB
    >2 Dog
    >5 Dog
    >3 Cat
    >8 Dog
    >
    >On Sheet2, I want to calculate the average of the values in ColA where
    >ColB says Dog.
    >
    >So sheet 2 would be:
    > Average
    >Dog 5
    >Cat 3
    >
    >
    >How can i do this?
    >
    >Thank you!!


    Just another thought -- you could use a Pivot Table.

    With a cell in your table selected:

    Data/Pivot Table

    Then drag Col B to the Rows area
    Col A to the Data area

    Right click on the Data
    Field Settings
    Select Average of Column A

    Format to taste -- there are many options.
    --ron

+ 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