I have a Sharepoint list which contains a field which is calculated based on two other columns. However when the two other columns both contain zeroes the result comes out as #DIV/0!.

The actual formula is very simple it is: [columnA]/[ColumnB]

Both columns are formatted as numbers, I have tried this a few times and it comes out the same each time

  • 1
    What do you expect? Division by zero is mathematically undefined. Most programming languages and calculations either return a "division by zero" error of some sort or "undefined." You could do something like =IF([ColumnB]=0,"My own error message",[ColumnA]/[ColumnB]) – Rothrock Apr 19 '15 at 17:30

You can not divide by zero.

Use this to check if the denominator is equal to zero.

=IF([ColumnB]=0,"Division By Zero!",[ColumnA]/[ColumnB])

Why can't we divide by zero?
How different programming languages handle division by 0?

  • In case ColumnB is empty or string value it is better to use: IF(ISERROR([ColumnA]/[ColumnB]),"Div by zero",[ColumnA]/[ColumnB]) – Danny '365CSI' Engelman Apr 20 '15 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.