Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This site is like first coffee in the winter morning..."

Geography

Where in the world do Tek-Tips members come from?
SBSMedicalTech (Programmer)
16 Apr 12 9:53
I am needing help creating a Percentage Formula. When I ran my original formula, I got back a division by zero error. My hunch tells me I need to account for values in zero with IF and ELSE somehow. Basically I need to know the collection ratio and account for zero payments. Any assistance is appreciated.

{data.ChargeAmount}/{data.PaymentAmount} * 100
Helpful Member!  briangriffin (Programmer)
16 Apr 12 10:53
Not sure why post is being doubled...

Depending on your database, you may need to trap for nulls also:

CODE

if isnull({data.paymentamount})
or {data.paymentamount} = 0
then 0

else

{data.chargeamount}/{data.paymentamount} * 100



You can also eliminate the "* 100" by using:

{data.chargeamount}%{data.paymentamount}
 
SBSMedicalTech (Programmer)
16 Apr 12 11:58
Thank you kindly for your assistance.  
SkipVought (Programmer)
16 Apr 12 12:18

Your formula logically seems to me to be 'up side down.' Seems it should be...

{data.paymentamount}/{data.chargeamount} * 100

If the account holder has paid NOTHING on a chargeamount of 1000, then the percent paid is 0%

If the account holder has paid 100 on 1000, then the percent paid is 10%.

So what would (1000/100) * 100, which equals 1000%, actually mean as a result of YOUR formula?





 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close