Finding an average of two columns with some same, some different identifiers, vlookup? ifavg?

DCDireWolf

New Member
Joined
Jul 30, 2018
Messages
3
I have a list of names in column A, a list of their numeric scores in Column B. Then I have a list of names in Column C, some of these names are the same as in Column A, some are different, and a list of their numeric scores in Column D.

I'd like to return the average score (the average of the values in columns B and D that match that name) of each person using formulas into a new two new columns (F and G), one with the name, one with the average.

See example below, assume cell A1 contains "Name 1". Do I use IFAVG? VLOOKUP? Both? Something else? Help!!

A B C D E F G
Name 1ScoreName 2ScoreNameAverage Score
John12Roger24John
Jill4John55Jill
****3Jill5Roger
Harry6Lazlow99****
Alice1Bethany122Lazlow
Bill2Bill3Alice
Frank9Frank54Bethany
Lisa11Lisa56Bill
Darlene12Annette98Frank
Lisa
Darlene
Annette
Harry

<colgroup><col span="6"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
If you are allowed to use PowerQuery you can try
- load source table to PQ editor
- duplicate table
- remove name2 and score2 from the first, change name1 to name
- remove name1 and score from the second table, change name2 and score2 to name and score
- append these tables
then try this
Code:
let
    Source = Table.Combine({Table1, #"Table1 (2)"}),
    #"Grouped Rows" = Table.Group(Source, {"Name"}, {{"Avg", each List.Average([Score]), type number}, {"Sum", each List.Sum([Score]), type number}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Name", Order.Ascending}})
in
    #"Sorted Rows"

NameAvgSum
****
3​
3​
Alice
1​
1​
Annette
98​
98​
Bethany
122​
122​
Bill
2.5​
5​
Darlene
12​
12​
Frank
31.5​
63​
Harry
6​
6​
Jill
4.5​
9​
John
33.5​
67​
Lazlow
99​
99​
Lisa
33.5​
67​
Roger
24​
24​
 
Upvote 0
A
B
C
D
E
F
G
1
Name 1ScoreName 2ScoreNameAverage Score
2
John
12​
Roger
24​
John
33.5​
3
Jill
4​
John
55​
Jill
4.5​
4
****
3​
Jill
5​
Roger
24​
5
Harry
6​
Lazlow
99​
****
32​
6
Alice
1​
Bethany
122​
Lazlow
99​
7
Bill
2​
Bill
3​
Alice
1​
8
Frank
9​
Frank
54​
Bethany
122​
9
Lisa
11​
Lisa
56​
Bill
2.5​
10
Darlene
12​
Annette
98​
Frank
31.5​
11
Lisa
33.5​
12
Darlene
12​
13
Annette
98​
14
Harry
6​

<tbody>
</tbody>



G2=
AVERAGEIF($A$2:$D$10,$F2,$B$2:$D$10) copy down
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

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