# Calculated If statement

863
2
10-12-2020 02:42 PM
Occasional Contributor III

How do you write an If statement based on a value from previous fields. If TYPECODE = 3 and MCF is > 500 calculate 1801 Engineering Dept as the answer? My statement below doesn't seem to work. Any help would be appreciated!

\${TYPECODE}='3' and if(\${A00MCFTOTAL}>500,"1801 Engineering Dept"))

Tags (2)
1 Solution

Accepted Solutions
Esri Regular Contributor

Hi Jordan

Your expression is almost there; try putting the and argument inside the if() statement. Also, if() statements require three arguments: a condition; the result if the condition is true; and the result if the condition is false, i.e.

if(condition, value if true, value if false)

So your expression could look something like:

if(\${TYPECODE}='3' and \${A00MCFTOTAL}>500,'1801 Engineering Dept','Some other value')

Replace 'Some other value' with the desired output if false (use '' for a blank).

Please find more on formulas here Formulas—ArcGIS Survey123 | Documentation

Best,
Jim

2 Replies
Esri Regular Contributor

Hi Jordan

Your expression is almost there; try putting the and argument inside the if() statement. Also, if() statements require three arguments: a condition; the result if the condition is true; and the result if the condition is false, i.e.

if(condition, value if true, value if false)

So your expression could look something like:

if(\${TYPECODE}='3' and \${A00MCFTOTAL}>500,'1801 Engineering Dept','Some other value')

Replace 'Some other value' with the desired output if false (use '' for a blank).

Please find more on formulas here Formulas—ArcGIS Survey123 | Documentation

Best,
Jim

Occasional Contributor III

Thank you! this is perfect!