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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#NUM! Error 2

Status
Not open for further replies.

grendal

MIS
Sep 30, 2001
35
GB
HI,
I've a formula as follows:-
=([JANSALES]-[JANCOST])/[JANSALES]
This caluculates the profit margin on a Sales report. However when faced with either or both fields containing zero's - I get the #NUM! error. Is there a way around this.

Cheers s-)
Some girls mothers are bigger than other girls, mothers. (The Smiths)
 
Hiw are ya grendal . . . . .

[ol][li]What do you want the field to show if [blue]JANSALES[/blue] = 0 ? (divisor = 0)[/li]
[li]If [blue]JANCOST[/blue] = 0 the equation returns [purple]1[/purple]. Do you want to show [purple]1[/purple] or something else?[/li][/ol]

Calvin.gif
See Ya! . . . . . .
 
You may try to play with the IIf function:
=IIf([JANSALES]=0, 0, ([JANSALES]-[JANCOST])/[JANSALES])


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Whoops - forgot to say thanks. Great tips!

Cheers s-)
Some girls mothers are bigger than other girls, mothers. (The Smiths)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top