Solved

division by zero when export in Adobe

Posted on 2009-05-11
3
392 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 34

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 34

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now