Help with if statement to calculate score

I am getting the following error message when trying to convert my XLSform. Can someone please help me with my if statement syntax?

Error: ODK Validate Errors:

XForm is invalid. See above for the errors.
: Invalid calculate for the bind attached to “${resp_rate_score}” : Bad node: org.javarosa.xpath.parser.ast.ASTNodeAbstractExpr@614ddd49 in expression if(( ${resp_rate} <20 or >=50), 3, if ( ${resp_rate} >=20 and <=25), 2, if ( ${resp_rate} >=40 and <=49), 2,0)

The following files failed validation:
${SATS} ODK XLSForm .xml

Result: Invalid

Thanks,

Aya

Welcome to the community, @ayafannymd! You could use the following if-statement to see if it works for you:

if((${resp_rate} <20 or ${resp_rate} >=50),3,if((${resp_rate} >=20 and ${resp_rate} <=25),2,if((${resp_rate} >=40 and ${resp_rate} <=49), 2,0)))

However, I would advise you to check out the or and and operators you have used within the if-statement.