I’m currently working to finish up a project for one of my classes at school and I came across a bit of a Microsoft Excel problem.

If you try to divide by zero Excel throws a fit telling you to “#DIV/0!”

If you need the possibility of a zero in the divisor of one of your formulas without your worksheet spewing obscenities use the IF command with the following template:

=IF(test, if true result, else)

An Example:

=IF(A2=0,0,A1/A2)

This would result in the number 0 placed in the cell, effectively censoring Excel from telling you that you can’t divide by 0.

This also works with Google Docs.

What were you doing?

I was trying to setup a spreadsheet to evaluate entrepreneurial ventures but sometimes the values for certain sections needed to be zero. An example, we needed to account for both retail and manufacturing firms. However since retail firms don’t have manufacturing costs the spreadsheet has to realize you might be trying to compute manufacturing numbers where the divisor is 0.

Thanks to LifeHacker for the tip.