Solved

Divide by zero error

Posted on 2014-01-13
2
417 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
[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 101

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

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

627 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