Solved

Divide by zero error

Posted on 2014-01-13
2
415 Views
Last Modified: 2014-01-13
I have a formula that on certain items will cause a divide by zero error.  I need to figure out how to get past this and not calculate the formula if there is a zero.

({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100
0
Comment
Question by:delta1734
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39777938
You need to test for the 0 divisor before dividing

Try this
If  {@perpetual} = 0 then
    0
Else
    ({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100 

Open in new window


You can have it return any value if it is 0

If you want it to be blank then

If  {@perpetual} <> 0 then
     ({XFGMULTI.NEW_QUAN} / {@perpetual}) * 100 

Open in new window


mlmcc
0
 

Author Closing Comment

by:delta1734
ID: 39778118
The first example was exactly what I needed.  Thanks!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question