@iferror
Hi!
I think that the idea of the OP is to exclude extreme values, so your formula doesn't work as it doesn't exclude all repetitions of the max and min values, while @Hui's one does.
With the data 1,1,1,1,1,10,20,100,100,100, I'd expect to get a 15 which doesn't happen with your formula.
However let @jennifer define what suits better her requirements.
Regards!
Thanks @Colin Legg i didn't know that... Got to search the web for all new functions in the last few version of excel, it's about time (even though i still prefer array entered count(if on the modern countifs )