I want to calculate the average over a range (B1:B12 or C1:C12 in the figure), excluding:
- Cells not being numeric, including Empty strings, Blank cells with no contents,
#NA
, text, etc. (B1+B8:B12 or C1+C8:C12 here).
- Cells for which corresponding cells in a range (A1:A12 here) have values outside an interval ([7,35] here). This would further exclude B2:B3 or C2:C3.
At this point, cells in column A may contain numbers or have no contents.
I think it is not possible to use any built-in AVERAGE
-like function. Then, I tried calculating the sum, the count, and divide. I can calculate the count (F2 and F7), but not the sum (F3), when I have #N/A
in the range, e.g.
How can I do this?
Notes:
- Column G shows the formulas in column F.
- I cannot filter and use
SUBTOTAL
.
- B8:C8 contain Blank cells with no contents, B9:C9 contain Empty strings.
- I am looking for (non-user defined) formulas, i.e., non-VBA.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…