Hi all,

I am looking to do an AVERAGEIF, but only for "x" number of the highest values within a range.

Example:

We have one tab with 3 columns:

Office Name City Employees
Clarendon DC 4
Georgetown DC 5
Horace Mann DC 6

There are multiple offices within the same city.

We have another tab with 3 columns:

City Number of selected offices Avg number of employees for selected offices
DC 2 ????

As you can see, I am looking to compute the avg number of employees in an office for DC, but we are only taking the 2 offices with the highest number of employees.

I canīt think of any conceivable way to do this. Can anyone help please?