Conditional averages from arrayed data with mutiple variables

AdMission

New Member
Joined
Mar 22, 2018
Messages
15
I have a complex set of circumstances that I want to calculate averages from. The array on the left has data of 3 different candidates that were assessed on 5 different metrics by 4 different assessors. For each candidate, the same assessor that scores for M1 also gives a score for a different metric, such that different combinations of assessors and metrics scored are unique.

From these data, I want to find three fundamentally different types of averages (1-Overall Candidate Avg Score; 2-Composite Avg Exclude Assessor; and 3- Assessor Influence Avg).

1 - this is simple enough and is just the averages of the scores from all 5 metrics for each candidate.
2 - this is a little more complex and calculates four different averages (2A-2D). 2A = the scores for each candidate excluding the assessor that rendered two different scores. For example, YJ gave two scores to candidate 1420 that will be excluded. 2B, 2C, and 2D will calculate averages of 4 scores and cycle through excluding the other assessors' scores, respectively.
3 - this will calculate the impact each assessor has on candidate average scores. To do this, it will find the average absolute difference each assessors' exclusion is from the overall candidate average score -- in other words, how different is any given assessors' opinion from the consensus?


1
candidatemetricassessorscoreCandidate
Overall Candidate Avg Score
1420M1YJ21420
1420M2MB31452
1420M3HG31444
1420M4YJ22A
2B
2C
2D
1420
M5LT4Candidate
Composite Avg1 Exclude Assessor2x
Composite Avg2 Exclude Assessor1x
Composite Avg3 Exclude Assessor1x
Composite Avg4 exclude assessor1x
1452M1QK41420
1452M2QK41452
1452M3MD11444
1452M4YJ13
1452M5MB5Assessor
Assessor Influence Avg
1444M1BT1BT
1444M2DM3DM
1444M3BT4HG
1444M4RN3LT
1444M5MB2MB
MD
QK
RN
YJ

<colgroup><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="208"><col width="207"><col width="206"><col width="204"></colgroup><tbody>
</tbody>
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
thank you!!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
ABCDEFGHIJKLMN
1
2candidatemetricassessorscoreCandidateOverall Candidate Avg Score
31420M1YJ214202.8
41420M2MB314523
51420M3HG314442.6
61420M4YJ22A2B2C2D
71420M5LT4CandidateComposite Avg1 Exclude Assessor2xComposite Avg2 Exclude Assessor1xComposite Avg3 Exclude Assessor1xComposite Avg4 exclude assessor1x
81452M1QK41420YJ3.333333333MB2.75HG2.75LT2.5
91452M2QK41452QK2.333333333MD3.5YJ3.5MB2.5
101452M3MD11444BT2.666666667DM2.5RN2.5MB2.75
111452M4YJ13
121452M5MB5AssessorAssessor Influence Avg
131444M1BT1BT0.066666667
141444M2DM3DM0.1
151444M3BT4HG0.05
161444M4RN3LT0.3
171444M5MB2MB0.7
18MD0.5
19QK0.666666667
20RN0.1
21YJ1.033333333

<tbody>
</tbody>
Sheet7

Worksheet Formulas
CellFormula
H3=AVERAGEIFS(D:D,A:A,F3)
H8=AVERAGEIFS($D:$D,$A:$A,$F8,$C:$C,"<>"&G8)

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
G8{=INDEX($C$3:$C$17,SMALL(IF($A$3:$A$17=$F8,IF(MATCH($A$3:$A$17&"|"&$C$3:$C$17,$A$3:$A$17&"|"&$C$3:$C$17,0)=ROW($C$3:$C$17)-ROW($C$3)+1,ROW($C$3:$C$17)-ROW($C$3)+1)),COLUMNS($F8:G8)/2))}
H13{=SUM(IF($G$8:$M$10=F13,ABS($H$8:$N$10-SUMIF($F$3:$F$5,$F$8:$F$10,$H$3:$H$5))))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



As you said, the formula for the overall score is quite easy (H3). In order to get the composite average excluding each of the assessors in turn, I found it necessary to add a column which listed each of them. Enter the array formula in G8, then copy it to G9:10, I8:I10, K8:K10, M8:M10. Once that is in place, the formula for the average excluding that assessor is fairly easy (H8). Copy that to all the appropriate cells.

Finally, with those in place, the Assessor Influence average is not too hard (H13). The biggest issue I see is what to do when an assessor shows up more than once. For example, MB is on all 3 candidates, with differences of .05, .5, and .15 which sum to .7. I could divide by the number of times MB appears if you want. You'd just need to change the SUM to AVERAGE in the H13 formula.

In any event, let me know what you think.
 
Last edited:
Upvote 0
Eric, this helps tremendously! I will try it out on my real data set tomorrow (which is very large) and see if it does what I hope. Thanks a million.
 
Upvote 0
Hi AdMission!

Try this small modification in Eric's suggestion:

In H2 and copy down

=AVERAGEIF(A$2:A$16,F2,D$2:D$16)

In G7 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down

=INDEX(C$2:C$16,MATCH(2,IF(A$2:A$16=F7,COUNTIFS(A$2:A$16,F7,C$2:C$16,$C$2:$C$16)),0))

In H7 and copy down and copy the range H7:H9 to the ranges J7:J9; L7:L9 and N7:N9

=AVERAGEIFS($D$2:$D$16,$A$2:$A$16,$F7,$C$2:$C$16,"<>"&G7)

In I7 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down and copy the range I7:I9 to the ranges K7:K9 and M7:M9

=INDEX($C$2:$C$16,SMALL(IF(IF($A$2:$A$16=$F7,COUNTIFS($A$2:$A$16,$F7,$C$2:$C$16,$C$2:$C$16))=1,
ROW($A$2:$A$16)-ROW($A$2)+1),CEILING(COLUMNS($I7:I7),2)/2))

In the range H13:J13 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down

=TRANSPOSE(ABS(IFERROR(1/(1/MMULT(IF($G$7:$M$9=F13,$H$7:$N$9,),{1;1;1;1;1;1;1}))-$H$2:$H$4,0)))


ABCDEFGHIJKLMN
1candidatemetricassessorscoreCandidateOverall Candidate Avg Score
21420M1YJ214202,80
31420M2MB314523,00
41420M3HG314442,60
51420M4YJ22A2B2C2D
61420M5LT4CandidateComposite Avg1 Exclude Assessor2xComposite Avg2 Exclude Assessor1xComposite Avg3 Exclude Assessor1xComposite Avg4 exclude assessor1x
71452M1QK41420YJ3,33MB2,75HG2,75LT2,50
81452M2QK41452QK2,33MD3,50YJ3,50MB2,50
91452M3MD11444BT2,67DM2,50RN2,50MB2,75
101452M4YJ13
111452M5MB5Assessor Influence Avg
121444M1BT1Candidate/Assessor142014521444
131444M2DM3BT0,000,000,07
141444M3BT4DM0,000,000,10
151444M4RN3HG0,050,000,00
161444M5MB2LT0,300,000,00
17MB0,050,500,15
18MD0,000,500,00
19QK0,000,670,00
20RN0,000,000,10
21YJ0,530,500,00
22
**************************************************************************************************

<tbody>
</tbody>


Markmzz
 
Upvote 0
I have run into an additional complication; occasionally a set of candidates are assessed by 5 different people, and thus, there are no repeats...just 5 single assessors. How might the formulas derived for H7 and the rest of the exclude assessors columns be modified to accommodate this?
 
Upvote 0
I have run into an additional complication; occasionally a set of candidates are assessed by 5 different people, and thus, there are no repeats...just 5 single assessors. How might the formulas derived for H7 and the rest of the exclude assessors columns be modified to accommodate this?

Hi AdMission!

Try this small modification:

In G7 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down

=IFERROR(INDEX(C$2:C$16,MATCH(2,IF(A$2:A$16=F7,COUNTIFS(A$2:A$16,F7,C$2:C$16,$C$2:$C$16)),0)),"")

In H7 and copy down and copy the range H7:H9 to the ranges J7:J9; L7:L9, N7:N9 and P7:P9

=IF(G7="","",AVERAGEIFS($D$2:$D$16,$A$2:$A$16,$F7,$C$2:$C$16,"<>"&G7))

In I7 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down and copy the range I7:I9 to the ranges K7:K9, M7:M9 and O7:O9

=IFERROR(INDEX($C$2:$C$16,SMALL(IF(IF($A$2:$A$16=$F7,COUNTIFS($A$2:$A$16,$F7,$C$2:$C$16,$C$2:$C$16))=1,
ROW($A$2:$A$16)-ROW($A$2)+1),CEILING(COLUMNS($I7:I7),2)/2)),"")


In the range H13:J13 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down

=TRANSPOSE(ABS(IFERROR(1/(1/MMULT(IF($G$7:$O$9=F13,$H$7:$P$9,),{1;1;1;1;1;1;1;1;1}))-$H$2:$H$4,0)))


ABCDEFGHIJKLMNOPQ
1candidatemetricassessorscoreCandidateOverall Candidate Avg Score
21420M1YJ214202,80
31420M2MB314523,00
41420M3HG314442,60
51420M4YJ22A2B2C2D2D
61420M5LT4CandidateComposite Avg1 Exclude Assessor2xComposite Avg2 Exclude Assessor1xComposite Avg3 Exclude Assessor1xComposite Avg4 exclude assessor1xComposite Avg5 exclude assessor1x
71452M1QK41420YJ3,33MB2,75HG2,75LT2,50
81452M2QK41452QK2,33MD3,50YJ3,50MB2,50
91452M3MD11444QK3,00DM2,50BT2,25RN2,50
101452M4YJ13
111452M5MB5Assessor Influence Avg
121444M1QK1Candidate/ Assessor142014521444
131444M2DM3BT0,000,000,35
141444M3BT4DM0,000,000,10
151444M4RN3HG0,050,000,00
161444M5MB2LT0,300,000,00
17MB0,050,500,00
18MD0,000,500,00
19QK0,000,670,40
20RN0,000,000,10
21YJ0,530,500,00
22
***********************************************************************************************************************

<tbody>
</tbody>


Markmzz
 
Upvote 0
Hi AdMission!

Try this small modification:

In G7 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down

=IFERROR(INDEX(C$2:C$16,MATCH(2,IF(A$2:A$16=F7,COUNTIFS(A$2:A$16,F7,C$2:C$16,$C$2:$C$16)),0)),"")

In H7 and copy down and copy the range H7:H9 to the ranges J7:J9; L7:L9, N7:N9 and P7:P9

=IF(G7="","",AVERAGEIFS($D$2:$D$16,$A$2:$A$16,$F7,$C$2:$C$16,"<>"&G7))

In I7 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down and copy the range I7:I9 to the ranges K7:K9, M7:M9 and O7:O9

=IFERROR(INDEX($C$2:$C$16,SMALL(IF(IF($A$2:$A$16=$F7,COUNTIFS($A$2:$A$16,$F7,$C$2:$C$16,$C$2:$C$16))=1,
ROW($A$2:$A$16)-ROW($A$2)+1),CEILING(COLUMNS($I7:I7),2)/2)),"")


In the range H13:J13 the Array Formula (use Ctrl+Shift+Enter to enter the formula) and copy down

=TRANSPOSE(ABS(IFERROR(1/(1/MMULT(IF($G$7:$O$9=F13,$H$7:$P$9,),{1;1;1;1;1;1;1;1;1}))-$H$2:$H$4,0)))

Markmzz

My head just exploded....this is better than me on my best day.

thanks.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top