#error in stoplight formula

B

Bendinblues

I'm getting a #error (division by zero) in the field referenced by the
indicator. is it possible to test for this and force the indicator to red? At
the moment the field is blank, with no stoplight.
 
J

JulieS

Hello Bendinblues,

Without knowing your current formula I can only advise in
generalities.

I suggest adding an additional piece to the field formula to trap the
division by zero. For example:
IIf([Field] <> 0, (Your formula here), "NA").

Then in the indicator set "NA" to red.

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional information
about Microsoft Project
 
B

Bendinblues

Here's my formula now. IIf([Cost2]<>0,(([Cost4]/[Cost2]))*100,"NA")

What needs to happen is an NA should appear when Cost2 is equal to 0.
However, the #ERROR still remains.

Can you help, please?
 
J

JulieS

Hi Bendinblues,

I tried your formula in a text field and it worked just fine --
displaying "na" when [Cost2] = 0. What type of field (Text1, NumberX,
DateX, etc) are you attempting to add the formula to?

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional information
about Microsoft Project

Bendinblues said:
Here's my formula now. IIf([Cost2]<>0,(([Cost4]/[Cost2]))*100,"NA")

What needs to happen is an NA should appear when Cost2 is equal to
0.
However, the #ERROR still remains.

Can you help, please?

Bendinblues said:
I'm getting a #error (division by zero) in the field referenced by
the
indicator. is it possible to test for this and force the indicator
to red? At
the moment the field is blank, with no stoplight.
 
B

Bendinblues

The fields used for the calculations are costx fields. I'm looking to compare
% variance between projected cost (cost4) and actual cost (cost2) by dividing
cost4 by cost2 and multiplying by 100. The formula that calculates this %
variance is placed in a numberx field. It's this filed that is referenced by
teh Stoplight.
 
J

JulieS

A number field cannot contain anything other than numbers, so the "NA" will
cause an error. Put the formula in a Text field and all should work fine.
Using a text field would also allow you to append a % sign to the result.

IIf([Cost2]<>0,(([Cost4]/[Cost2]))*100 & "%","NA")


I hope this helps.

Julie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top