Share via

Max Averageif formula

Anonymous
2020-01-18T13:46:03+00:00

Hi all.

I have a sheet studying tested cars and their corresponding MPG values (see below)

I have already found which manufacturer has the highest average MPG:

{=INDEX(A2:A20,MATCH(MAX(AVERAGEIF(B2:B20,B2:B20)),AVERAGEIF(B2:B20,B2:B20),0))}

The above formula returns the manufacturer name, but now I want the corresponding average for that manufacturer.

Any help would be appreciated.

thanks.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2020-01-18T14:27:29+00:00

    That's great. But check your original formula as that is not supposed to give right result.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-01-18T14:03:47+00:00

    Hello Aurelien21

    I am V. Arya, Independent Advisor, to work with you on this issue. The picture is missing, hence it is not possible to say what is in column B.

    But I doubt if your formula will give right result. Right array entered formula would be

    =INDEX(A2:A20,MATCH(MAX(AVERAGEIF(A2:A20,A2:A20,B2:B20)),AVERAGEIF(A2:A20,A2:A20,B2:B20),0))

    Below formulas will get you the highest average

    =AGGREGATE(14,6,AVERAGEIF(A2:A20,A2:A20,B2:B20),1)

    =MAX(INDEX(AVERAGEIF(A2:A20,A2:A20,B2:B20),,))

    OR you can array enter following formula

    =MAX(AVERAGEIF(A2:A20,A2:A20,B2:B20))

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-01-18T14:22:34+00:00

    Thank you V. Arya

    I will stick to HansV's simpler formula as my actual workbook has some 60,000 entries, so avoiding Arrays where possible is best :)

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-01-18T14:08:35+00:00

    Ah, how obvious and simple!!

    Thanks very much HansV

    Was this answer helpful?

    0 comments No comments
  5. HansV 462.6K Reputation points
    2020-01-18T13:58:21+00:00

    Let's say your formula for the manufacturer with the highest average MPG is in cell D2.

    The following formula will return the average MPG for that manufacturer is

    =AVERAGEIF(A2:A20,D2,B2:B20)

    Was this answer helpful?

    0 comments No comments