Using only numbers that lie inside some interval

Hello,

I want to use from one column only numbers that lie in some interval (say, between 0 and 10). I want to calculate their sum, average, median and whatever else is possible with them. So, numbers from the column that lie outside the interval must be totally ignored.

Is this possible and how?

Sincerely,
Nikola

You can use an array evaluation of the form

=AVERAGE(IF((0<=A1:A6)*(A1:A6<=10);A1:A6;""))

Close the formula cell input with Shift+Ctrl+Enter instead of just Enter for array mode.

Note this works only with functions that ignore text content elements (returned by the IF() here for non-matching values), like SUM(), AVERAGE(), MEDIAN(), …

LibreOffice Help on SUMIFS function.

LibreOffice Help on COUNTIFS function.

LibreOffice Help on AVERAGEIFS function.

Yes, but there is no MEDIANIFS() or other …IFS().

Thank you very much.

By the way, I tried averaging with averageifs, but I was always getting errors. I didn’t find what was wrong.

For the same example that should be

=AVERAGEIFS(A1:A6;A1:A6;">=0";A1:A6;"<=10")

Thank you very much.