Forum Discussion

topcat777's avatar
topcat777
Frequent Visitor
6 years ago
Solved

Get Average based on several categories

Hi

 

Hoping you guys can help me. Searched the internet for a soloution but at a loss.

 

I have some data like the below that lets me know the time work has taken. I know anything over 10 in the time column is an error and I want to replace this with the average. So on row 4 I would want to return the average of all Emma's UK Build jobs, excluding the outliers. So in the case, the average or the first 3 rows, as they meet the criteria (Name= Emma, Area = UK, Task = Build, Time <10).

 

Row 8 would also be replaced with 1.5, an average of rows 6 and 7 that meet Emma/UK/Repair/<10. 

 

Job NumberNameAreaTaskTime
1EmmaUKBuild2
2EmmaUKBuild3
3EmmaUKBuild4
4EmmaUKBuild18
5EmmaUSABuild1

6

EmmaUKRepair2
7EmmaUKRepair1
8EmmaUKRepair11
9DaveUKRepair5
10DaveUSARepair1

 

I don't know if this is the best way to do it but I was going to add a column that returned the Time if it was less than 10 but replaced it with the average if it was >=10. For the life of me I just can't figure out how to return that average when I have 3 catagories to match to.

 

I hope you guys can help me.

 

Thanks in advance.

Thom

2 Replies