Took me SO FUCKING LONG to do this, but I finally managed. Excel functions can be so annoying sometimes. Who would've thought that AVERAGEIF doesn't work with generated cells but COUNTIF does? Anyway, here it is. "Restricted mean" is the mean for the values within 2 standard deviations, and "Very restricted mean" is for values within 1 standard deviation, of the mean.