Solved

# Division by 0 error check

Posted on 2012-03-29
239 Views
Hi guys whats the syntax trap Div/0 errors

=SUM((\$B\$34)/(\$B\$33)) <===== else 0

Thanks
0
Question by:kingjely

LVL 45

Assisted Solution

Martin Liss earned 100 total points
ID: 37785685
0

LVL 45

Assisted Solution

Martin Liss earned 100 total points
ID: 37785689
0

LVL 8

Author Comment

ID: 37785692
=IFERROR(SUM((\$B\$34)/(\$B\$33)),"0")
=IFERROR(SUM((\$B\$34)/(\$B\$33)),"END OF MONTH")
=IFERROR(SUM((\$B\$34)/(\$B\$33)),0)

These all get the error #NAME?

Why?
0

LVL 29

Assisted Solution

IrogSinta earned 50 total points
ID: 37785757
It looks like each of these have a non-breaking space (&nbsp) at the end so I'm assuming you copied the formula from a webpage and unintentionally included a space.  This space is not the same character as the one produced when hitting the spacebar on your keyboard.  Just delete that extra space after the last parenthesis and your formula should work.
0

LVL 8

Author Comment

ID: 37785762
Hi
I copied and pasted from my spreadsheet directly onto here

=IFERROR(SUM((\$B\$34)/(\$B\$33)),0)
=IFERROR(SUM((\$B\$34)/(\$B\$33)),"0")
=IFERROR(SUM((\$B\$34)/(\$B\$33)),"END OF MONTH")

Both dont work
0

LVL 16

Assisted Solution

Peter Kwan earned 50 total points
ID: 37785821

=if(iserror(SUM((\$B\$34)/(\$B\$33))),0)
0

LVL 50

Accepted Solution

barry houdini earned 50 total points
ID: 37786882
SUM function isn't required here, lets remove that for a start so you are left with

=\$B\$34/\$B\$33

Now that will only give you a #DIV/0 error if the divisor (B33 here) is zero or blank, so you can check that

=IF(\$B\$33=0,0,\$B\$34/\$B\$33)

IFERROR is only available in Excel 2007 and later - in earlier versions you'll get #NAME? error, my suggestion will work in any version of Excel

regards, barry
0

## Featured Post

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…