Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Divide by zero error

Posted on 2014-01-13
2
Medium Priority
?
420 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:Kim Williamson
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 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:Kim Williamson
ID: 39778118
The first example was exactly what I needed.  Thanks!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Loops Section Overview
Suggested Courses

971 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