Solved

division by zero when export in Adobe

Posted on 2009-05-11
3
404 Views
Last Modified: 2012-05-06
I have a report where I want to see the percentage of the amt that insurance company paid on the total amt charged.
I originally entered this formula but got a DIVISION BY ZERO error when exporting into Adobe.
 ccur({Archrg99.Ins_Paid}) % ccur({Archrg99.Chrg_Amt})

So, I tried to alter the appointment by entering  this formula but still get the error.
if {Archrg99.Ins_Paid} = "0"
then
0
else
(ccur({Archrg99.Ins_Paid}) % ccur({Archrg99.Chrg_Amt}))

The problem is that some insurance companies have not paid yet so the INS_PAID amount may be zero.  When I check the formula (either one) it says there are no errors and the report runs.  I only get the error when exporting in Adobe.

Can you help.
Kate Rogers
0
Comment
Question by:kvrogers
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24358771
Why are you checking the Ins_Pais amount.  You need to check the Chrg_Amt since that is the field you are dividing by.

mlmcc
0
 
LVL 35

Accepted Solution

by:
James0628 earned 500 total points
ID: 24360570
Basically, what mlmcc said.  It's fine (mathematically) if Ins_Paid is 0.  That will just give you a 0 result.  If you're getting a "divide by 0" error, Chrg_Amt must be 0 (Or possibly null?) in some records, and that's the field you need to check.  If Chrg_Amt could ever be null, revise your formula to:

if IsNull ({Archrg99.Chrg_Amt}) or {Archrg99.Chrg_Amt} = "0"
then
0
else
(ccur({Archrg99.Ins_Paid}) % ccur({Archrg99.Chrg_Amt}))


 If Chrg_Amt won't be null, you can leave out the IsNull test.

 I assume from your test for = "0" (with quotes) that these fields are strings.  Obviously testing for "0" will only match that exact string.  If a zero could be represented in other ways ("00", "0.00", etc.), then you'd need to alter that test accordingly.  Likewise, if the fields could ever be something other than a number, you should test for that too.

 James
0
 
LVL 35

Expert Comment

by:James0628
ID: 24502204
To be fair, if the problem was that you were checking Ins_Paid for 0 instead of Chrg_Amt, mlmcc probably deserves most of the credit (and points) for pointing that out first.

 James
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

685 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