I'm writing a gross profit % formula. Basically Sales less costs / Costs = GP%
Eg. Sales = 100, Costs = 75, GP = 25
(100 less 75) / 75 = 33%
The formula works great in the above situation whereby the GP is not equal to 0. However, my formula does not work in scenarios whereby the GP is = 0. This is where Crystal generates the "Divison by zero" error message
Here's what the CR formula looks like:
If {@Total Sale} <> 0.00 Then (({@Total Sale} - {WOITEMS.TOTALCOST}) / {WOITEMS.TOTALCOST}) * 100
Else 100.00
I'd like to know a way to resolve this. Any suggestions are much appreciated.
Eg. Sales = 100, Costs = 75, GP = 25
(100 less 75) / 75 = 33%
The formula works great in the above situation whereby the GP is not equal to 0. However, my formula does not work in scenarios whereby the GP is = 0. This is where Crystal generates the "Divison by zero" error message
Here's what the CR formula looks like:
If {@Total Sale} <> 0.00 Then (({@Total Sale} - {WOITEMS.TOTALCOST}) / {WOITEMS.TOTALCOST}) * 100
Else 100.00
I'd like to know a way to resolve this. Any suggestions are much appreciated.