An updated version of this post has been published here:http://easy-excel.com/?p=381
In the table below we get the #DIV/0! error because there are no values in the cells that the formula refers to. Let’s see how we can avoid it.
You don’t want to make any changes only in the cells that turn out to return this error message – that will get you in trouble if you change the data later, so we’ll write a formula that takes into account that some cells are empty.
Let’s wrap the IFERROR function around it:
=B4/C4 becomes =IFERROR(B4/C4,”-“)
What we do is to tell Excel to return whatever is between the double quotes (“) if the formula returns an error. Problem solved!