I want to compare the data in column A and B in excel. For every cell in B that matches any cell in A I want to take the corresponding value in C and add this up. Then I want to get the average of these cells in C.
Example:
A B C D
jan jan 8 apple
piet kees 7 apple
bas erik 9 pear
jan piet 2 kiwi
tom kiwi
lies apple
jan pear
sam lemon
kees pear
In the example above I would want the outcome to be 5.66666 if you consider column A, B and C. The numbers in column C that correstpond with 'jan', 'kees', and 'piet' in column B are averaged, because the names in column B also are listed in column A.
Additionally I would want to also add in column D. How can I also add that I only want the people in A that have 'apple' listed in column D. So the outcome in the example above would be 7.5
