2 Replies Latest reply on Sep 3, 2012 5:48 AM by Stephen Davie

# IF calculation with AND

Apologies if this is a really simple question but I am new to calculated fields and don't quite understand the syntax yet.

What I am wanting to do is assign certain percentages a colour:

0-69.9% = Red

70-84.9% = Amber

85% + = Green

I have created a simple calculated field with 2 values and got this working fine, but when I have tried 3 values I have got stuck. My formula at the moment is:

IF SUM([Positive Outcomes (PO)]) < 0.7 THEN

"Red"

ELSEIF SUM([Positive Outcomes (PO)]) > 0.7 AND < 0.85 THEN

"Amber"

ELSE

"Green"

END

The issue is with the "AND", but I don't know how else I could do this?

Any help would be greatly appreciated. Thanks in advance.

• ###### 1. Re: IF calculation with AND

Try this:

IF SUM([Positive Outcomes (PO)]) <= 69.9 THEN 'Red'

ELSEIF SUM([Positive Outcomes (PO)]) >= 0.7 AND SUM([Positive Outcomes (PO)]) <= 0.85 THEN 'Amber'

ELSE 'Green' END

• ###### 2. Re: IF calculation with AND

Brilliant - works a treat! Goodness know's why I didn't try that in the first place - I'll blame Monday morning-ness!

Thanks a lot.