By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

#Num!

P: 46
One of my text fields in a report is:
=Sum([ConfAttendance])/Sum([ConfOffrate])

But how do I use the IIF statement on it to prevent the #NUM! error when dividing by zero?


Thanks!
Mar 14 '08 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 2.5K+
P: 2,545
Hi. Use of IIF to do this is
Expand|Select|Wrap|Line Numbers
  1. =IIF(Sum([ConfOffrate])=0, Null, Sum([ConfAttendance])/Sum([ConfOffrate]))
I have placed Null as the return value, as it would be inappropriate to return a value in such circumstances. Theoretically the result of division by zero is infinity. If you need to return a value for any reason change Null to 0, but understand that it is not representing the result of the division itself.

-Stewart
Mar 14 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.