I am having trouble nesting multiple if AND statements in an XLSform for Survey123.
I am getting the follwing error: cannot handle function 'if' requires 3 arguments. Only 1 provided.
Here is my formula:
if(AND(${homelessness}="1to2yrs", ${mhDis}="Yes",1,if(AND(${homelessness}="1to2yrs", ${PhyDevOther}="Yes",1,if(AND(${homelessness}="1to2yrs", ${AlcDrugs}="Yes",1,if(AND(${homelessness}="1to2yrs", ${HIVAIDS}="Yes",1,if(AND(${homelessness}="other", ${mhDis}="Yes",1,if(AND(${homelessness}="other", ${PhyDevOther}="Yes",1,if(AND(${homelessness}="other", ${AlcDrugs}="Yes",1,if(AND(${homelessness}="other", ${HIVAIDS}="Yes",1,if(AND(${homeless_times}="4", ${mhDis}="Yes",1,if(AND(${homeless_times}="4", ${PhyDevOther}="Yes",1,if(AND(${homeless_times}="4", ${AlcDrugs}="Yes",1,if(AND(${homeless_times}="4", ${HIVAIDS}="Yes",1))))))))))))))))))))))))
Any help is greatly appreciated.