Hello,

I'm having trouble programming the intelligent report with conditional calculations.

"AV" is calculated from the average of the results obtained, applying a different formula depending on the case.

The cases are as follows:

98.5% ≤ Mean ≤ 101.5% --> **AV = k*s**

Mean < 98.5% --> **AV = 98.5 - Mean + K*s**

Mean > 101.5 --> **AV = Mean – 101.5 +K*s**

Where k is a constant (2.4) and s is standard deviation.

I have thought about this option (as an excel formula):

=IIF(Xlan<98.5, 98.5-Xlan+2.4*Slan, IIF(Xlan>101.5, Xlan-101.5+2.4*Slan, 2.4*Slan))

Where:

- Xlan is the mean saved as variable
- Slan is the standard deviation saved as variable

but it causes me a error in the program and changes it to this:

=IIF(Xlan<98.Code(DVL("5")),98.Code(DVL("5"))Xlan+2.4*slan,IIF(Xlan>101.Code(DVL("5")),Xlan-101.Code(DVL("5"))+2.4*slan,2.4*slan))

Why doesn't the formula work?

How could I set up the formula in a simple way?

¡A lot of thanks!

Òscar

Hello,

Can you tell me what version of Chemstation you are using? Is the formula being used in a table column or in a single field?

Marty Adams