<?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 Re: How to implement this formula in Excel Form (Survey123) in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753895#M1632</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;Thanks so much for your prompt response. Much appreciated!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An example would greatly help&lt;/STRONG&gt; enhance my understanding of your elegant solution (it is currently hard for me to comprehend to be useful).&lt;/P&gt;&lt;P&gt;To give you additional info,&lt;/P&gt;&lt;P&gt;The value being averaged is NOT in a repeat, since the question being asked has a different text in the question. (Do you suggest that I try a 'repeat' feature?)&lt;/P&gt;&lt;P&gt;However, it is a 'select_one' question. The answer choices are: NA, 0, 1, 2, 3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Aug 2018 21:09:53 GMT</pubDate>
    <dc:creator>GeorgeSuresh</dc:creator>
    <dc:date>2018-08-20T21:09:53Z</dc:date>
    <item>
      <title>How to implement this formula in Excel Form (Survey123)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753893#M1630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: small;"&gt;=AVERAGEIF(B25:B29,"&amp;lt;&amp;gt;NA")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: small;"&gt;I understand that Excel Form is NOT Excel Spreadsheet. (&lt;/STRONG&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: small;"&gt;This works beautifully in Excel Spreadsheet.)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: small;"&gt;However, my customer would like this implemented in the Survey123 app that I'm developing.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: small;"&gt;How would I go about solving this issue?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: small;"&gt;Tags:&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: small;"&gt;survey123 numbers‌&amp;nbsp;#survey123 #Excel form&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 16:59:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753893#M1630</guid>
      <dc:creator>GeorgeSuresh</dc:creator>
      <dc:date>2018-08-20T16:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement this formula in Excel Form (Survey123)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753894#M1631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi George,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that the value being averaged is in a repeat. This can be done with at least 1 hidden question, though possibly 2 are required depending on the form layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first question needed is a calculate question to store whether this repeat should be calculated or not. &amp;nbsp;This can be done with the following function:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(${q} != "NA", 1, 0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This will store 0 if the value is NA, and 1 otherwise. &amp;nbsp;A sum() function outside the repeat will then count the number of answers that are not NA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the question with the values being stored is a select_one question, you can make the "NA" value 0 - a zero value will not impact the average calculation and you can then do sum(${q}/sum(${&amp;lt;COUNTING_QUESTION&amp;gt;). &amp;nbsp;If the question is not a select_one, you would need to have a second calculate question to store the values that should be used in the average; it will need the following formula:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(${q} != "NA", ${value_question}, 0)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One thing to note in constructing these is to set the bind::type column to &lt;STRONG&gt;int&lt;/STRONG&gt; or &lt;STRONG&gt;decimal&lt;/STRONG&gt; (depending on the value type) so that formulas treat them as&amp;nbsp;numeric values (instead of text values).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 18:01:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753894#M1631</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-20T18:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement this formula in Excel Form (Survey123)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753895#M1632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;Thanks so much for your prompt response. Much appreciated!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An example would greatly help&lt;/STRONG&gt; enhance my understanding of your elegant solution (it is currently hard for me to comprehend to be useful).&lt;/P&gt;&lt;P&gt;To give you additional info,&lt;/P&gt;&lt;P&gt;The value being averaged is NOT in a repeat, since the question being asked has a different text in the question. (Do you suggest that I try a 'repeat' feature?)&lt;/P&gt;&lt;P&gt;However, it is a 'select_one' question. The answer choices are: NA, 0, 1, 2, 3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 21:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753895#M1632</guid>
      <dc:creator>GeorgeSuresh</dc:creator>
      <dc:date>2018-08-20T21:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement this formula in Excel Form (Survey123)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753896#M1633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi George,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find an example with both attached. &amp;nbsp;Whether to use repeats or not depends on the survey design - if the questions are asking about scores in distinct categories, repeats may not make sense. &amp;nbsp;If they are asking about multiple observations of the same property, repeats would make sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A couple of issues complicate matters slightly:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;select_one questions cannot receive a bind::type value, so the values must be manually converted to numbers as part of the calculation. &amp;nbsp;In the separate fields version, this is done in the averaging function. &amp;nbsp;In the repeat version, this is done with a second hidden field&lt;/LI&gt;&lt;LI&gt;Given that 0 is a valid answer, you would need to have a second, hidden question as described in my first response.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 21:34:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753896#M1633</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-20T21:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement this formula in Excel Form (Survey123)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753897#M1634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks James, for the example.&lt;/P&gt;&lt;P&gt;In the example with 'no repeat', how do you avoid a possible 'Divide by Zero'?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2018 23:12:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753897#M1634</guid>
      <dc:creator>GeorgeSuresh</dc:creator>
      <dc:date>2018-08-20T23:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement this formula in Excel Form (Survey123)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753898#M1635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi George,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could wrap the divisor in an if() statement checking their sum for 0 and instead place a 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 00:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-this-formula-in-excel-form/m-p/753898#M1635</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-21T00:33:41Z</dc:date>
    </item>
  </channel>
</rss>

