<?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: Age calculation in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871445#M28259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you multiple it by 12, you will get months:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #201f1e; background-color: #ffffff; font-size: 14.6667px;"&gt;((decimal-date-time(today())-decimal-date-time(${birthday})) div 365.25)*12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #201f1e; background-color: #ffffff; font-size: 14.6667px;"&gt;You can use this reference guide to tweak the result with either int() or round() depending on what value you want.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;You could get really fancy with if() and calculate years if the birthday is further away than 1 year or months if the birthday is less than 1 year in the one field, though you may want it to be a text field so you could append "months" or "years" on the end so it's not confusing.&lt;/P&gt;&lt;TABLE style="color: #4c4c4c; background-color: white; border: 1px solid #cccccc; font-size: 0.875rem; margin-bottom: 1.55rem;"&gt;&lt;TBODY class=""&gt;&lt;TR class="" style="border-bottom: 1px solid #cccccc;"&gt;&lt;TD colspan="1" rowspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;if(condition, a, b)&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="1" rowspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;If true, returns a; otherwise, returns b.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jun 2020 23:28:26 GMT</pubDate>
    <dc:creator>ChelseaRozek</dc:creator>
    <dc:date>2020-06-11T23:28:26Z</dc:date>
    <item>
      <title>Age calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871442#M28256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to subtract two dates to calculate the age&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/457090_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;I have this survey, there is the question of today's date, then I bring the date of birth, but by subtracting both dates in the next question it makes me wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2019 14:22:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871442#M28256</guid>
      <dc:creator>CUARTA_OPORTUNIDADLOCAL</dc:creator>
      <dc:date>2019-08-15T14:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Age calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871443#M28257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ismael has an example in his blog post:&amp;nbsp;&lt;A href="https://community.esri.com/groups/survey123/blog/2016/04/17/dates-and-time-in-survey123-for-arcgis"&gt;https://community.esri.com/groups/survey123/blog/2016/04/17/dates-and-time-in-survey123-for-arcgis&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="background-color: #ffffff; border: 1px solid #c6c6c6; margin: 0px 0px 2px;" width="100%"&gt;&lt;THEAD style="border: inherit solid inherit; font-weight: inherit;"&gt;&lt;TR style="background-color: #efefef; border: inherit solid inherit; font-weight: inherit;"&gt;&lt;TH class="" style="font-weight: bold; padding: 5px; width: 16.3239%;"&gt;&lt;/TH&gt;&lt;TH class="" style="font-weight: bold; padding: 5px; width: 25.5784%;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;EPOCH Format&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH class="" style="font-weight: bold; padding: 5px; width: 53.856%;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Decimal Date Format&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR style="background-color: #efefef; border: inherit solid inherit; font-weight: inherit;"&gt;&lt;TH class="" style="font-weight: bold; padding: 5px; width: 16.3239%;"&gt;Calculate age from birthday&lt;/TH&gt;&lt;TH class="" style="font-weight: bold; padding: 5px; width: 25.5784%;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;int((today() - ${birth_date}) div (1000*24*60*60* 365.25))&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH class="" style="font-weight: bold; padding: 5px; width: 53.856%;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;int((decimal-date-time(today()) - decimal-date-time(${birth_date})) div 365.25)&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;/TABLE&gt;&lt;P&gt;Also, it looks like you're missing the proper ${fieldname} notation in your calculation.&lt;/P&gt;&lt;P&gt;You can use today() in the calculation to automatically get today's date without having to use another question in your survey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2019 15:52:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871443#M28257</guid>
      <dc:creator>ChelseaRozek</dc:creator>
      <dc:date>2019-08-15T15:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Age calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871444#M28258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;This was quite helpful. Decimal Date format works with both connect and the web as opposed to the EPOCH Format which appears to work with the Field app only. Question: how can you do a calculation for the age of a baby in months? I was able to get the calculation to work in years but what formula can I use to calculate the age of a baby in months?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2020 22:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871444#M28258</guid>
      <dc:creator>TRDSYSTEMS</dc:creator>
      <dc:date>2020-05-26T22:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Age calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871445#M28259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you multiple it by 12, you will get months:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #201f1e; background-color: #ffffff; font-size: 14.6667px;"&gt;((decimal-date-time(today())-decimal-date-time(${birthday})) div 365.25)*12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #201f1e; background-color: #ffffff; font-size: 14.6667px;"&gt;You can use this reference guide to tweak the result with either int() or round() depending on what value you want.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;You could get really fancy with if() and calculate years if the birthday is further away than 1 year or months if the birthday is less than 1 year in the one field, though you may want it to be a text field so you could append "months" or "years" on the end so it's not confusing.&lt;/P&gt;&lt;TABLE style="color: #4c4c4c; background-color: white; border: 1px solid #cccccc; font-size: 0.875rem; margin-bottom: 1.55rem;"&gt;&lt;TBODY class=""&gt;&lt;TR class="" style="border-bottom: 1px solid #cccccc;"&gt;&lt;TD colspan="1" rowspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;if(condition, a, b)&lt;/P&gt;&lt;/TD&gt;&lt;TD colspan="1" rowspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;P&gt;If true, returns a; otherwise, returns b.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 23:28:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/age-calculation/m-p/871445#M28259</guid>
      <dc:creator>ChelseaRozek</dc:creator>
      <dc:date>2020-06-11T23:28:26Z</dc:date>
    </item>
  </channel>
</rss>

