I am looking for a script that will allow me to take the average of several cells, but if the cell is blank, for it to be ignored.
For example, if I have five cells, and all five have numbers in them, I just need the total divided by 5.
But if I have five cells, and only four are filled in with numbers, then I want it to just be averaged by 4.
I think I explained it well enough, but let me know if you have other questions or need more info.
Cell 1 | Cell 2 | Cell 3 | Cell 4 | Cell 5 | Average |
---|---|---|---|---|---|
5 | 5 | 3 | 4 | 7 | (5+5+3+4+7)/5=avg |
5 | 3 | 4 | 7 | (5+3+4+7)/4=avg |
I don't want the blank cells to be calculated in (I don't want a zero averaged in), but I need a script that I can apply to several rows like the above.