Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF, still returning #error

Status
Not open for further replies.

Cheveliar

IS-IT--Management
Feb 4, 2003
15
US
I have written the following IIF statement:

IIf([Wins]/([Wins]+[Losses])=0,0,([Wins]/([Wins]+[Losses])))

The reason I wrote it this way because I have fields that would give me a 0/0 scenario. I'd like to account for this and return a 0 in that instance. Is there a way to do this or am I doomed to get the #error?
 
Hi

It is division by zero you must avoid, so should it be:



IIf([Wins]+[Losses]=0,0,([Wins]/([Wins]+[Losses])))



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top