<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic nesting if AND formula in XLSform. in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877582#M29672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having trouble nesting multiple if AND statements in an XLSform for Survey123.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the follwing error: cannot handle function 'if' requires 3 arguments. Only 1 provided.&lt;/P&gt;&lt;P&gt;Here is my formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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))))))))))))))))))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jan 2020 20:11:07 GMT</pubDate>
    <dc:creator>Alex_Dale</dc:creator>
    <dc:date>2020-01-02T20:11:07Z</dc:date>
    <item>
      <title>nesting if AND formula in XLSform.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877582#M29672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having trouble nesting multiple if AND statements in an XLSform for Survey123.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the follwing error: cannot handle function 'if' requires 3 arguments. Only 1 provided.&lt;/P&gt;&lt;P&gt;Here is my formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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))))))))))))))))))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2020 20:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877582#M29672</guid>
      <dc:creator>Alex_Dale</dc:creator>
      <dc:date>2020-01-02T20:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: nesting if AND formula in XLSform.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877583#M29673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If statements require three arguments: a condition; the result if the condition is true; and the result if the condition is false. It looks like the final &lt;EM&gt;false&lt;/EM&gt; argument is missing&amp;nbsp;(i.e. what to return if &lt;EM&gt;all&lt;/EM&gt; conditions are false).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, the XLSForm syntax for &lt;STRONG&gt;and&lt;/STRONG&gt; statements is to use the word "and" between two expressions. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;${homelessness}='1to2yrs'&amp;nbsp;&lt;STRONG&gt;and&lt;/STRONG&gt; ${mhDis}='Yes'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XLSForm functions are detailed here:&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm"&gt;Formulas—Survey123 for ArcGIS | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2020 02:36:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877583#M29673</guid>
      <dc:creator>Jim-Moore</dc:creator>
      <dc:date>2020-01-03T02:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: nesting if AND formula in XLSform.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877584#M29674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jim,&lt;/P&gt;&lt;P&gt;The new syntax somewhat worked.  Now, however, the first IF function&lt;/P&gt;&lt;P&gt;overrides the rest of the nested IF functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if($&lt;SPAN __jive_macro_name="homelessness"&gt;="1to2yrs"and $&lt;SPAN __jive_macro_name="mhDis"&gt;&lt;/SPAN&gt;="Yes",1,2) or
if($&lt;/SPAN&gt;="1to2yrs"and $&lt;SPAN __jive_macro_name="PhyDevOther"&gt;="Yes",1,2) or
if($&lt;SPAN __jive_macro_name="homelessness"&gt;="1to2yrs"and $&lt;SPAN __jive_macro_name="AlcDrugs"&gt;&lt;/SPAN&gt;="Yes", 1,2)
 or if($&lt;/SPAN&gt;="1to2yrs"and $&lt;SPAN __jive_macro_name="HIVAIDS"&gt;&lt;/SPAN&gt;="Yes",1,2) or
if($&lt;SPAN __jive_macro_name="homelessness"&gt;="other"and $&lt;SPAN __jive_macro_name="mhDis"&gt;&lt;/SPAN&gt;="Yes",1,2) or
if($&lt;/SPAN&gt;="other"and $&lt;/SPAN&gt;="Yes",1,2)&lt;/P&gt;&lt;P&gt; or if($&lt;SPAN __jive_macro_name="homelessness"&gt;="other"and $&lt;SPAN __jive_macro_name="AlcDrugs"&gt;&lt;/SPAN&gt;="Yes", 1,2) or
if($&lt;/SPAN&gt;="other"and $&lt;SPAN __jive_macro_name="HIVAIDS"&gt;="Yes",1,2) or
if($&lt;SPAN __jive_macro_name="more_than_1"&gt;="Yes"and $&lt;SPAN __jive_macro_name="mhDis"&gt;&lt;/SPAN&gt;="Yes",1,2)
or if($&lt;/SPAN&gt;="Yes"and $&lt;SPAN __jive_macro_name="PhyDevOther"&gt;&lt;/SPAN&gt;="Yes",1,2)or
if($&lt;SPAN __jive_macro_name="more_than_1"&gt;="Yes"and $&lt;SPAN __jive_macro_name="AlcDrugs"&gt;&lt;/SPAN&gt;="Yes",1,2)or
if($&lt;/SPAN&gt;="Yes"and $&lt;/SPAN&gt;="Yes",1,2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex Dale&lt;/P&gt;&lt;P&gt;Data Manager&lt;/P&gt;&lt;P&gt;Partners In Care, Oahu’s Continuum of Care&lt;/P&gt;&lt;P&gt;200 North Vineyard Boulevard, Suite 210&lt;/P&gt;&lt;P&gt;Honolulu, HI 96817&lt;/P&gt;&lt;P&gt;Phone: (808) 543-2242&lt;/P&gt;&lt;P&gt;Email: adale@auw.org&lt;/P&gt;&lt;P&gt;www.partnersincareoahu.org&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOGETHER, WE CAN END HOMELESSNESS&lt;/P&gt;&lt;P&gt;Partners in Care’s mission is to eliminate homelessness through open and&lt;/P&gt;&lt;P&gt;inclusive participation and the coordination of integrated responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Jan 2020 21:11:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877584#M29674</guid>
      <dc:creator>Alex_Dale</dc:creator>
      <dc:date>2020-01-05T21:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: nesting if AND formula in XLSform.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877585#M29675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way you had nested the if statements in your original post looks correct, besides the syntax for the&amp;nbsp;&lt;EM&gt;and&lt;/EM&gt;&amp;nbsp;function and the missing false argument for the final if statement. As a simple example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;if(${fruit}='banana','yellow',if(${fruit}='apple','green',if(${fruit}='strawberry','red','no fruit selected')))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2020 02:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/nesting-if-and-formula-in-xlsform/m-p/877585#M29675</guid>
      <dc:creator>Jim-Moore</dc:creator>
      <dc:date>2020-01-06T02:54:44Z</dc:date>
    </item>
  </channel>
</rss>

