Index and match with result average

CaptainGravyBum

Board Regular
Joined
Dec 1, 2023
Messages
77
Office Version
  1. 365
Platform
  1. Windows
Hello,
I'm trying to find the correct formula to search for all instances of a name within column A and return the average of all the totals found in column G if that makes sense.
So if bob smith appears in column a five times and column g has values associated to those entries it will return an average of the totals.
At the moment, I have a formula that is looking up and matching the data, but only returning the first value it matches from column g.

=INDEX($G:$G,MATCH("Bob Smith",$A:$A,0))

I know I need an average or count or something else in the formula, but I'm not finding the correct answer.

Any help would be appreciated.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Well, the index/match is specifically for returning a value associated with the lookup value from one source to another. You need a completely different formula get what you're after.

Perhaps something like this:

Excel Formula:
=SUMIF($A:$A,"Bob Smith",$G:$G)/COUNTIF($A:$A,"Bob Smith")
 
Upvote 1
Another option
Excel Formula:
=AVERAGEIFS(G:G,A:A,"bob smith")
 
Upvote 1
Solution
Well, the index/match is specifically for returning a value associated with the lookup value from one source to another. You need a completely different formula get what you're after.

Perhaps something like this:

Excel Formula:
=SUMIF($A:$A,"Bob Smith",$G:$G)/COUNTIF($A:$A,"Bob Smith")

Hi @dreid1011,
Thanks for the quick response. I have tried the above formula but it keeps resulting in a #DIV/0! error so I'm not sure what's happening.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
I don't know either, but perhaps give Fluff's suggestion a try.
Sorry, I was being a pleb and referencing the wrong column. This formula works a treat as well so now I have two options to choose from.
Almost wish I hadn't spent the afternoon trying to google the answer 😉
 
Upvote 0
Sorry, I was being a pleb and referencing the wrong column. This formula works a treat as well so now I have two options to choose from.
Almost wish I hadn't spent the afternoon trying to google the answer 😉
Hah, well glad you got it sorted.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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