Archive Pages Design$type=blogging

Dealing with Divide-by-Zero Errors

In mathematics, division by zero is impossible. One way to understand why it’s impossible is to consider what happens when you divide...

In mathematics, division by zero is impossible. One way to understand why it’s impossible is to consider what happens when you divide a number by another.

Division is really nothing more than fancy subtraction. For example, 10 divided by 2 is the same as starting with 10 and continuously subtracting 2 as many times as needed to get to zero. In this case, you would need to continuously subtract 2 five times.
  • 10-2 = 8
  •   8-2 = 6
  •   6-2 = 4
  •   4-2 = 2
  •   2-2 = 0
So, 10/2 = 5.
Now if you tried to do this with 10 divided by 0, you would never get anywhere, because 10-0 is 10 all day long. You’d be sitting there subtracting 0 until your calculator dies.
  • 10-0 = 10
  • 10-0 = 10
  • 10-0 = 10
  • 10-0 = 10
  • …..Infinity

Mathematicians call the result you get when dividing any number by zero “undefined.” Software like Excel simply gives you an error when you try to divide by zero. In Excel, when you divide a number by zero, you get the #DIV/0! error.

You can avoid this by telling Excel to skip the calculation if your denominator is a zero. Figure 2-9 illustrates how to do this by wrapping the division operation in Excel’s IF function.
=IF(C4=0, 0, D4/C4)
Figure 2-9: Using the IF function to avoid a division-by-zero error

How it works

The IF function requires three arguments: the condition; what to do if the condition is true; and what to do if the condition is false.
The condition argument in this example is the budget in C4 is equal to zero (C4=0). Condition arguments must be structured to return TRUE or FALSE, and that usually means that there is a comparison operation (like an equal sign or greater-than sign).

If the condition argument returns TRUE, the second argument of the IF function is returned to the cell. The second argument is 0, meaning that you simply want a zero displayed if the budget number in cell C4 is a zero.

IF the condition argument is not zero, the third argument takes effect. In the third argument, you tell Excel to perform the division calculation (D4/C4).

So this formula basically says that if C4 equals 0, then return a 0, or else return the result of D4/C4.

COMMENTS

Name

Applied Linguistics Books Composition computer skills excel Grammar Linguistics Literature Morpho-Syntax Reading Sociolinguistics Spoken English Translation&Interpretation Writing
false
ltr
item
English Studies: Dealing with Divide-by-Zero Errors
Dealing with Divide-by-Zero Errors
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3jDE_eHTZ4FrVcSkYGPmG-PDi2WCj5V2WXRkJwgvehxEPMSQCEwl5B0VadpptuD1C62Z8mKRe49ApXbdTeXsHPzRIDxENp0Vjn7j5Vaox7fvaLGodAH0MMGZfCrr66MWq2nbglpQYF94L/s200/excel-round-function.jpeg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3jDE_eHTZ4FrVcSkYGPmG-PDi2WCj5V2WXRkJwgvehxEPMSQCEwl5B0VadpptuD1C62Z8mKRe49ApXbdTeXsHPzRIDxENp0Vjn7j5Vaox7fvaLGodAH0MMGZfCrr66MWq2nbglpQYF94L/s72-c/excel-round-function.jpeg
English Studies
https://engstudy2.blogspot.com/2015/08/dealing-with-divide-by-zero-errors.html
https://engstudy2.blogspot.com/
http://engstudy2.blogspot.com/
http://engstudy2.blogspot.com/2015/08/dealing-with-divide-by-zero-errors.html
true
8027978048540096527
UTF-8
Not found any posts VIEW ALL Read More Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago