calculating average with multiple criteria and removing outliers

bercier

New Member
Joined
Mar 20, 2020
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Good afternoon,

I have built with power query a list of payments made for the last 4 years to employee's. I am trying to calculate the bi-weekly average salary of those 10 000 employee's based on 2 criteria's. For each employee / fiscal year, I want to find the average bi-weekly payment. I want to remove the outliers top 10% and bottom 10% in column H for each combo of employee / fiscal year.

Column A - Criteria 1 employee number: 1, 2, 3...10 000
Column F - Criteria 2 fiscal year of the payment : 2016, 2017, 2018,...)

Column H - Bi-weekly payment amount received

Thank you
Sylvain
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
IMHO, you have not provided sufficient details for us to provide a turnkey solution.

Also, the "top 10% and bottom 10%" are not necessarily "outliers", in the statistical sense.

That said, take a look at TRIMMEAN. It does remove the top and bottom x% of the data.

Perhaps you would array-enter (press ctrl+shift+Enter instead of just Enter) a formula of the following form:

=TRIMMEAN(IF($A$1:$A$10000=C1, IF($F$1:$F$10000=C2, $H$1:$H$10000)), 20%)

PS.... I am not familiar with Power Query, so I do not know if and how such formulas would fit with its use.
 
Upvote 0
IMHO, you have not provided sufficient details for us to provide a turnkey solution.

Also, the "top 10% and bottom 10%" are not necessarily "outliers", in the statistical sense.

That said, take a look at TRIMMEAN. It does remove the top and bottom x% of the data.

Perhaps you would array-enter (press ctrl+shift+Enter instead of just Enter) a formula of the following form:

=TRIMMEAN(IF($A$1:$A$10000=C1, IF($F$1:$F$10000=C2, $H$1:$H$10000)), 20%)

PS.... I am not familiar with Power Query, so I do not know if and how such formulas would fit with its use.
 
Upvote 0
thank you so much it works!! now just got to find a way to do it on a much larger data set.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

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