+ Reply to Thread
Results 1 to 5 of 5

Averaging Values in Multiple Columns, with Conditions

  1. #1
    Registered User
    Join Date
    12-26-2012
    Location
    Florida
    MS-Off Ver
    Office 365
    Posts
    54

    Averaging Values in Multiple Columns, with Conditions

    I am a teacher creating a grade book in Excel. Each student is in a single row, with columns for the various assignments. For data analysis purposes, I am trying to develop formulas to make two different calculations.

    The first calculation is simply the average quiz grade for all students, for all quizzes.

    The second calculation is the average quiz grade for all grades that are higher than zero. This will tell me the average quiz score for quizzes that have actually been attempted.

    I do need to track students that have withdrawn from the class, so column A will contain the letter "w" if the student has withdrawn from the class. If the student has withdrawn, the grades for that student should be ignored in the calculations.

    Since I do accept quizzes after their due dates, a particular quiz score will have an entry of "L" if it has not yet been taken. These entries also need to be ignored in the calculations.

    Please see the attached workbook for some sample data and the expected results.

    Thank you very much in advance for any assistance!
    Attached Files Attached Files

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Averaging Values in Multiple Columns, with Conditions

    Try these array formulae

    =AVERAGE(IF((ISNUMBER($C$2:$E$6))*($A$2:$A$6<>"w"),$C$2:$E$6))
    =AVERAGE(IF((ISNUMBER($C$2:$E$6))*($A$2:$A$6<>"w")*($C$2:$E$6<>0),$C$2:$E$6))

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Averaging Values in Multiple Columns, with Conditions

    For the first one:
    =SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),C2:E6,0))/SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),1,0))
    for the second one:
    =SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),C2:E6,0))/(SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),1,0))-COUNTIF(C2:E6,0))

    Both are array formulas (need to be confirmed with ctrl+shift+enter)

  4. #4
    Registered User
    Join Date
    12-26-2012
    Location
    Florida
    MS-Off Ver
    Office 365
    Posts
    54

    Re: Averaging Values in Multiple Columns, with Conditions - Solved

    Quote Originally Posted by Bob Phillips View Post
    Try these array formulae

    =AVERAGE(IF((ISNUMBER($C$2:$E$6))*($A$2:$A$6<>"w"),$C$2:$E$6))
    =AVERAGE(IF((ISNUMBER($C$2:$E$6))*($A$2:$A$6<>"w")*($C$2:$E$6<>0),$C$2:$E$6))
    Thank you very much!

  5. #5
    Registered User
    Join Date
    12-26-2012
    Location
    Florida
    MS-Off Ver
    Office 365
    Posts
    54

    Re: Averaging Values in Multiple Columns, with Conditions

    Quote Originally Posted by yudlugar View Post
    For the first one:
    =SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),C2:E6,0))/SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),1,0))
    for the second one:
    =SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),C2:E6,0))/(SUM(IF(A2:A6="w",0,1)*IF(ISNUMBER(C2:E6),1,0))-COUNTIF(C2:E6,0))

    Both are array formulas (need to be confirmed with ctrl+shift+enter)
    Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula help (averaging multiple columns)
    By xceller8 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 07-06-2013, 10:06 PM
  2. Replies: 3
    Last Post: 06-26-2012, 06:19 PM
  3. Issues with averaging 3 values with conditions applied
    By mcaanda in forum Excel General
    Replies: 10
    Last Post: 11-21-2010, 03:25 PM
  4. Excel 2007 : Averaging multiple columns row by row
    By UtahDude in forum Excel General
    Replies: 1
    Last Post: 03-24-2010, 05:31 PM
  5. Averaging IF with multiple values
    By axc0054 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-05-2008, 02:56 PM

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