How do I avoid the "#DIV/0!" error in Google docs spreadsheet?

Aaron Shaver picture Aaron Shaver · Jul 6, 2011 · Viewed 99.2k times · Source

I have a column with average(K23:M23) that starts out with #DIV/0! when the K23 through M23 cells are empty. Preferably I'd like to only do the average of cells that contain non-zero, non-blank values. I think it's possible using the query command:

https://docs.google.com/support/bin/answer.py?hl=en&answer=159999

But their example doesn't help me.

Answer

Nik picture Nik · Jul 5, 2013

Wrap your formula with IFERROR.

=IFERROR(yourformula)