Try........
1] Using "Remove Duplicates" built-in function to create a "Sector" unique list in D3:D9
2] In E3, enter array formula (Ctrl+Shift+Enter) copied down :
=TRIMMEAN(IF($A$3:$A$340=D3,$B$3:$B$340),2/COUNTIF($A$3:$A$340,D3))
View attachment 66259
Regards
Bosco