Getting #DIV/0! in Microsoft Excel spreadsheet
Do not divide by zero or non-values
The obvious solution to this issue is of course to divide only with cells that have a value not equal to zero.
Use an if formula
A more elegant solution to this problem, especially when dealing with a spreadsheet that needs empty cells is to use an "if formula" similar to the example below.
=IF(A2="","",A2/A1)
In this above example if cell A2 is equal to "" (nothing) then print nothing. Otherwise divide the cell values A2 with A1. The above example could also be modified to perform a different calculation instead of printing nothing by replacing the second "" with a formula to be carried out or other text.
No comments:
Post a Comment