+ Reply to Thread
Results 1 to 11 of 11

Average based on multiple criteria

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    Vancouver
    MS-Off Ver
    Excel 2003
    Posts
    6

    Average based on multiple criteria

    Hi everyone,

    I`m working on an evaluation sheet for tour guides at a medium sized tour company. At the end of each trip all customers are asked to fill in a short customer satisfaction research and rate different parts of the tour on a scale of 1 to 5.

    All survey results are entered in an Excel sheet with the following columns:

    Column A: Tour date
    Column B: Destination
    Column C: Guide
    Column D - J: Results for organization, knowledge, friendliness etc.

    Sheet 2 gives an overview of the results and the average score for each guide. However, most guides guide tours to different destinations, so now I like to calculate the results for each individual tour.

    This is my formula to calculate the average score from one guide for all tours:
    =AVERAGE(IF(Questionaires!$C$2:$C$5000="Bob",Questionaires!$D$2:$D$5000))

    How can I modify this formula so it calculates the average from column D for only the tours to Vancouver (column B), guided by Bob(column C), and excluding the empty cells in column D?

    Thanks!
    Last edited by Bob-2012; 08-09-2012 at 01:38 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Average based on multiple criteria

    Try:

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-09-2012
    Location
    Vancouver
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Average based on multiple criteria

    That's exactly what I was looking for, thanks a lot!

  4. #4
    Registered User
    Join Date
    08-09-2012
    Location
    Vancouver
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Average based on multiple criteria

    I also like to display the number of entries for trips to Vancouver guided by Bob

    I got the following formula, but how do I now filter the results to only include the Vancouver trips from column B?

    =COUNTIF(Questionaires!C:C,"Bob")

    Secondly, column L contains the answers to the question "Would you recommend this tour?" (yes/no)
    I would like to calculate for each individual tour how many percent of the people answered this question with "yes"

    =COUNTIF(Questionaires!L:L,"Yes")/COUNTA(Questionaires!L:L) calculates the percentage for all tours, but how do I exclude everything but "Vancouver"?

    Thanks a lot for your help!
    Last edited by Bob-2012; 08-10-2012 at 06:57 PM.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702

    Re: Average based on multiple criteria

    Hello Bob,

    You can use SUMPRODUCT to count with multiple criteria in Excel 2003, e.g. this formula to count Bob's Vancouver tours

    =SUMPRODUCT((Questionaires!C$2:C$5000="Bob")*(Questionaires!B$2:B$5000="Vancouver"))

    Then using the same setup for the numerator you can divide the number of Vancouver tours that are recommended by the total number of Vancouver tours like this

    =SUMPRODUCT((Questionaires!L$2:L$5000="Yes")*(Questionaires!B$2:B$5000="Vancouver"))/MAX(1,COUNTIF(Questionaires!B$2:B$5000,"Vancouver"))

    [MAX stops you getting an error if there are no Vancouver tours]

    ....or if you want to get in to the murky world of array formulas (and who wouldn't? ) you can try this version for the same result

    =AVERAGE(IF(Questionaires!B$2:B$5000="Vancouver",IF(Questionaires!L$2:L$5000="Yes",1,0)))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  6. #6
    Registered User
    Join Date
    08-09-2012
    Location
    Vancouver
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Average based on multiple criteria

    Thanks for all the help, this is awesome!

    =AVERAGE(IF(Questionaires!$C$2:$C$4925="Chris",Questionaires!$D$2:$D$4925))

    Can this formula be modified so it also includes the data from Column D on the sheet "Rockies",for only the trips guided by Chis?

    Thanks a lot for your help!

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Average based on multiple criteria

    So you have another criteria on a different sheet? I am not sure that would work out.;... can you explain further?

  8. #8
    Registered User
    Join Date
    08-09-2012
    Location
    Vancouver
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Average based on multiple criteria

    Hi NBVC,

    My excel file has the following 3 sheets:

    Sheet 1: 'Questionnaires', survey results for all tours excluding the Rockies
    Sheet 2: 'Rockies', survey results for all tours to the Rocky Mountains
    Sheet 3: 'Results'

    The formulas in sheet 3 calculate the guides' averages for items like friendliness, commentary, ability to understand the guide and organization of the tour.

    The following formula is used to calculate the average based on all data in sheet 1:
    =AVERAGE(IF(Questionnaires!$C$2:$C$4925="Jordan",Questionnaires!$E$2:$E$4925))

    I like to modify the formula so that it also includes the data from sheet 2, so that the average for Jordan in this case includes the trips he guided to the Rocky Mountains.

    Thanks for your help!

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Average based on multiple criteria

    Try:

    =AVERAGE(IF(Questionnaires!$C$2:$C$4925="Jordan",Questionnaires!$E$2:$E$4925),IF(Rockies!$C$2:$C$4925="Jordan",Rockies!$E$2:$E$4925))

    confirmed with CTRL+SHIFT+ENTER not just ENTER... assumes same range locations and sizes in both sheets... adjust as necessary.

  10. #10
    Registered User
    Join Date
    08-09-2012
    Location
    Vancouver
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Average based on multiple criteria

    That's exactly what I was looking for.

    Can you also help me modify the following formulas to count the data from both sheets:

    =COUNTIF(Questionaires!C:C,"Bryson")

    =AVERAGE(Questionaires!E2:E4925)

    Thanks a lot again!

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Average based on multiple criteria

    =COUNTIF(Questionaires!C:C,"Bryson")+COUNTIF(Rockies!C:C,"Bryson")

    =AVERAGE(Questionaires!E2:E4925,Rockies!E2:E4925)

+ 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