I would like to know how to calculate variance (VAR, VARA, VARP) with criteria as in AVERAGEIF and AVERAGEIFS. The VARIF function does not seem to exist. This question also applies to others functions such as median, etc.
FILTER function can be used to first select the parts of the range that meet your criteria. That result can then be passed to VAR (e.g.
FILTER can also be used to filter one column based on a condition on another column. For example, if you have columns:
x | 1 y | 2 x | 3
You can find the
VAR for the rows that have
x in the first column like this:
=VAR(FILTER(B:B, A:A = "x"))