Dear all,
I have a formula as below:
=switch(A=0,"Black",B/switch(A,1,A)*100>0,"Black",B/switch(A,1,A)*100<0,"Red")
I use this formula to get rid of the "divide by zero" error, anyway, i get another error which isArgument 'VarExpr' is not a valid value instead of
Attempted to divide by zero after applying the above formula.
Does anyone have any ideas?
Thanks
Levine
Hi,
From your description, it seems that you met the "divided by zero" in your report, right?
If so, I think you should use IIF function to check the value first, and then, decide if it could be divide in the expression. See the following code:
=IIF(Fields!Deno.Value = 0, "N/A", (Fields!MyType.Value) / IIf(Fields!Deno.Value = 0, 1, Fields!Deno.Value))
Thanks.
No comments:
Post a Comment