Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • 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!

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

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

dividing by zero

dividing by zero

dividing by zero

I have a formula:

if isnull ({@Serious Event Count}) or ({@Serious Event Count}) = 0 then "0" else
totext(sum({@near miss count})/sum({@Serious Event Count}),0,"")

and when I run the report, it seems to be pulling only zero. For example if I have 9 serious safety events, and 27 near miss events, then my ratios should be 1 and 3 respectively, but I am getting 1 and 0. It works if I comment out the first line, but then if I have a situation where I am dividing by zero, then i get an error, so what should I do, I feel like I should rearrange the formula some how, but I am not getting it. I have played with this for hours, and I am getting the same thing. can some one please help. I need the formula to give me the number, and if the number is being divided by zero, then give me a zero.

Thanks in advance!!!

RE: dividing by zero

If possible try to modify this formula {@Serious Event Count} so that it can not return a null, Ideally it should return a value or zero.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

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! Already a Member? Login

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