+ Reply to Thread
Results 1 to 5 of 5

Need help with averages based on criteria.

  1. #1
    Registered User
    Join Date
    02-27-2009
    Location
    NC,US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Need help with averages based on criteria.

    Hello all,

    I'm a delivery driver and I've decided to start recording information about my deliveries: tip amount, age/race/se-x of the customer, etc.

    So my problem is this: How can I display an average of tips based on the criteria of a different column?

    For example one column records race as "W" for white, "B" for black, and "O" for other. Is there a way I can form an if statement to show me the average of only those values in column A(tips) where the corresponding value in column B(race)="W"?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need help with averages based on criteria.

    Given you're using Excel 2007 .. you can use AVERAGEIF
    (or AVERAGEIFS (multiple conditions))

    =AVERAGEIF(B1:B100,"W",A1:A100)

    would average A1:A100 where B1:B100 = "W"

    see XL Help for more info.

  3. #3
    Forum Contributor
    Join Date
    10-11-2007
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    251

    Re: Need help with averages based on criteria.

    Column A tip, Column B Black/White/Other
    =AVERAGE(IF(B1:B5="B",A1:A5,"")) + Ctrl + Shift + Enter
    Last edited by Steve R; 02-27-2009 at 06:23 AM. Reason: array formula

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need help with averages based on criteria.

    Steve R, you would need to enter that as an array w/CTRL + SHIFT + ENTER.

    Given 2007 has built in non-array function it would make most sense to use it!

    Also you don't need to use Null for FALSE ... a Logical FALSE will generate by default and obviously Logicals will be excluded in the average calculation, use:

    =AVERAGE(IF(B1:B5="B",A1:A5))

    Use the Evaluate formula tool for more info.

  5. #5
    Registered User
    Join Date
    02-27-2009
    Location
    NC,US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Need help with averages based on criteria.

    Well that was simpler than I thought, thanks a ton!

+ 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