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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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