How do I add multiple values in an array based on multiple hits?
Using your examples, with the averages on Sheet1,
Row 1 & 2 are labels,
Names in A3 to A5,
Sheet 2 - labels in Row1, from A1 to F1
*NOTE* - labels in B1 to F1 *must* match exactly to labels on Sheet 1, B1 to
D1.
Needless to say, the names in A2 to A4 of Sheet2 must also match *exactly*
to the names in Sheet1, from A3 to A5..
This formula, entered in B3 of Sheet1, will return the average for the name
in A3 for *all* occurrences in Sheet2 that match the column label in B1:
=SUMPRODUCT((Sheet2!$A$2:$A$4=$A3)*(Sheet2!$B$1:$F $1=B$1)*
Sheet2!$B$2:$F$4)/COUNTIF(Sheet2!$B$1:$F$1,B$1)
Copy this formula across to D3, and then down to Row5.
You could incorporate this formula with your formula for weighting the
averages.
--
HTH,
RD
---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Steve in Columbia" wrote in
message ...
Background:
I want to do this in Excel!
I have a table of weighted percentages for a grade book.
Currently they are weighted averages that look like this. They are the
sum
total
of all the students' quizzes, tests, and Homework assignments based on
their
weighted percentages. I'm using the sumproduct funtion in the AVG column
to
calculate the average based on the percentage weights. It works very well
and is and this allows me to change the weights if I decide to do so.
Students Quizzes Tests HW AVG
25% 65% 10%
Bob 100 90 100 94
Jim 50 100 100 88
Fred 50 50 100 55
Question:
I want a way to gather all and average all the data into its respective
column from another array. For example, the following would be their
scores:
Type HW Q T HW T
Bob 100% 100% 100% 100% 80%
Jim 100% 50% 100% 100% 100%
Fred 100% 50% 50% 100% 50%
All the homework (HW types) would roll up into an average in the HW column
in the first array, all the Quizes (Q types) would roll up into an average
in
the Quizzes column in the first array, and all the Tests (T types) would
do
the same in the tests column. Also - as you can see, the different types
are
not necessarily next to each other. Furthermore, If, for example, Fred
only
has one HW in, I want to be able to leave the other HWs blank if I choose
to
excuse him from that assignment. The AVERAGE function will do that just
fine, but I put this down in case the solution doesn't include that
function.
Any ideas anyone? This would be a life saver for me and I'd be ever so
grateful. I looked for a function in excel but couldn't find one.
Thanks - Steve
|