<?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: sumifs function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167001#M263857</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not following. Can you simplify such that you display what you have and what you want?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Nov 2014 22:16:02 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-11-11T22:16:02Z</dc:date>
    <item>
      <title>sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167000#M263856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;I am looking for sas procedure or sas function that similar to excel sumifs function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;SPAN&gt;I would to sum _FREQ_ in terms of &lt;/SPAN&gt;&lt;SPAN style="line-height: 107%; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-weight: bold;"&gt;msa_code_all and Auditor_Key where &lt;/SPAN&gt;&lt;SPAN style="background: white; line-height: 107%;"&gt;previousyear&amp;lt; yearend &amp;lt;= yearend&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;SPAN style="background: white; line-height: 107%;"&gt;So for&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="line-height: 107%; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-weight: bold;"&gt;msa_code_all(10100) and Auditor_Key(27) sum of freq should be 8(5+2+1) because yearends of three rows are smaller thanpreviousyear.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: #000000; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Sumifs function is in G column =SUMIFS(D$2:D$21,$A$2:$A$21,"="&amp;amp;$A3,$B$2:$B$21,"="&amp;amp;$B3,$C$2:$C$21,"="&amp;amp;$C3,$E$2:$E$21,"&amp;lt;="&amp;amp;$E3,$E$2:$E$21,"&amp;gt;"&amp;amp;$F3).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: #000000; font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;So far, I came up with the below code but does not work. Can you help me?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;summary &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=example &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;nway&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;class &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;Auditor_Key msa_code_all &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;var _FREQ_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;where &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;previousyear &amp;lt; yearend &amp;lt;= yearend ;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=testsum &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;=;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG style="line-height: 107%; color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; line-height: 107%; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 460px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="40" width="64"&gt;msa_code_all&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;SIC2&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;Auditor_Key&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;_FREQ_&lt;/TD&gt;&lt;TD class="xl66" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="64"&gt;yearend&lt;/TD&gt;&lt;TD class="xl67" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="90"&gt;previousyear&lt;/TD&gt;&lt;TD class="xl68" width="50"&gt;Sum of Freq&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10100&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;27&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20100301&lt;/TD&gt;&lt;TD align="right" class="xl73" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20090301&lt;/TD&gt;&lt;TD align="right" class="xl72"&gt;8&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10100&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;27&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20100201&lt;/TD&gt;&lt;TD align="right" class="xl73" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20090201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;0&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10100&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;27&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20100101&lt;/TD&gt;&lt;TD align="right" class="xl73" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20090101&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10100&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;27&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20031201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20021201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;36&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20040901&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20030901&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;36&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20030901&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20020901&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;46&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20011201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20001201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;60&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20110601&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20100601&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;2&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;60&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20100601&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20090601&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;60&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20090601&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20080601&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;2&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;60&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20080601&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20070601&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;60&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20070601&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20060601&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;60&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;846&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20060601&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20050601&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;51&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1091&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20041201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20031201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;51&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1091&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20031201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20021201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;51&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1091&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20021201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20011201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1091&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20041201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20031201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1091&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20031201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20021201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10180&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1091&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20021201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20011201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt; &lt;/TR&gt; &lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;" width="64"&gt;10420&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;7&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="64"&gt;20111201&lt;/TD&gt;&lt;TD align="right" class="xl71" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;" width="90"&gt;20101201&lt;/TD&gt;&lt;TD align="right" class="xl72" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;2&lt;/TD&gt; &lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 21:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167000#M263856</guid>
      <dc:creator>JPARK</dc:creator>
      <dc:date>2014-11-11T21:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167001#M263857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not following. Can you simplify such that you display what you have and what you want?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167001#M263857</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-11-11T22:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167002#M263858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry Reeza!&lt;/P&gt;&lt;P&gt;I want to get the same values in Sum of Freq column using sas code becuase I got that values with excel sumifs function.&lt;/P&gt;&lt;P&gt;my code does not work. do you know how to get values in Sum of Freq column using sas code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167002#M263858</guid>
      <dc:creator>JPARK</dc:creator>
      <dc:date>2014-11-11T22:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167003#M263859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand the logic of how that column is calculated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 00:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167003#M263859</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-11-12T00:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167004#M263860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me the issue is what records to include.&lt;/P&gt;&lt;P&gt;The first group defined by MSA*SIC*AUDITOR has 4 records that total to 9 not 8.&lt;/P&gt;&lt;P&gt;If you want to only include 3 of the 4 records for the first group what logic is excluding the fourth record?&lt;/P&gt;&lt;P&gt;The last column in your report does not make any sense given the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 00:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167004#M263860</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-11-12T00:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167005#M263861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about confusion.&lt;/P&gt;&lt;P&gt;Time matters.. 4th records's yearend(20031201) is not between first records' &lt;SPAN style="background: white;"&gt;previousyear(20090301)&lt;/SPAN&gt;&lt;SPAN style="background: white;"&gt;and yearend(20100301). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white;"&gt;First three records' yearends(20100301,20100201,20100101)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white;"&gt;are between &lt;/SPAN&gt;first records' &lt;SPAN style="background: white;"&gt;previousyear(20090301)&lt;/SPAN&gt;&lt;SPAN style="background: white;"&gt;and yearend(20100301). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 00:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167005#M263861</guid>
      <dc:creator>JPARK</dc:creator>
      <dc:date>2014-11-12T00:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167006#M263862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One easy way is to merge the data with itself.&amp;nbsp; This doesn't seem to get the same values, but perhaps the boundary conditions on the date ranges is wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; row+&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; msa_code_all SIC2 Auditor_Key _FREQ_ yearend previousyear what;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;informat&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; yearend previousyear &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;yymmdd8.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; yearend previousyear &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10100 67 27 5 20100301 20090301 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10100 67 27 2 20100201 20090201 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10100 67 27 1 20100101 20090101 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10100 67 27 1 20031201 20021201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 36 846 1 20040901 20030901 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 36 846 1 20030901 20020901 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 46 846 1 20011201 20001201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 60 846 2 20110601 20100601 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 60 846 1 20100601 20090601 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 60 846 2 20090601 20080601 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 60 846 1 20080601 20070601 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 60 846 1 20070601 20060601 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 60 846 1 20060601 20050601 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 51 1091 1 20041201 20031201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 51 1091 1 20031201 20021201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 51 1091 1 20021201 20011201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 67 1091 1 20041201 20031201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 67 1091 1 20031201 20021201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10180 67 1091 1 20021201 20011201 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;10420 7 2 2 20111201 20101201 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;distinct&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;a.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;*,sum(b._freq_) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; newvar&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , have b&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.msa_code_all = b.msa_code_all&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.SIC2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b.SIC2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.Auditor_Key &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b.Auditor_Key&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b.yearend between a.yearend &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.previousyear&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.msa_code_all&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , a.SIC2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , a.Auditor_Key&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , a.yearend&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , a.previousyear&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;order&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a.row&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 03:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167006#M263862</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-11-12T03:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167007#M263863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh my good~ It works!!!&lt;/P&gt;&lt;P&gt;Tom! Thank you so much!!! I changed&amp;nbsp; the boundary conditions on the date ranges to this.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; a.previousyear &amp;lt; b.yearend &amp;lt;= a.yearend &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 04:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/167007#M263863</guid>
      <dc:creator>JPARK</dc:creator>
      <dc:date>2014-11-13T04:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/313321#M263864</link>
      <description>Hi, first off thanks a lot for the post! This helped me out a lot as well! However, do you think there is a way to improve the performance? I am working with a data set of about 1.4gb and as you can imagine, it takes quite some time to run. I also need to run this with multiple conditions - the one condition increases the size a lot (I guess) and results in an error:&lt;BR /&gt;ERROR: Insufficient space in file WORK.'SASTMP-000000447'n.UTILITY.&lt;BR /&gt;ERROR: File WORK.'SASTMP-000000447'n.UTILITY is damaged. I/O processing did not complete.&lt;BR /&gt;&lt;BR /&gt;If you could please suggest something, it would be great!</description>
      <pubDate>Tue, 22 Nov 2016 02:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/313321#M263864</guid>
      <dc:creator>CharlFM</dc:creator>
      <dc:date>2016-11-22T02:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/313433#M263865</link>
      <description>&lt;P&gt;I think the line "and a.sic2 and b.sic2"&amp;nbsp; should be&amp;nbsp; "and a.sic2=b.sic2".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same with "and a.auditor_key and b.auditor_key".&amp;nbsp; Should be "and a.auditor_key=b.auditor_key", yes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MK&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/313433#M263865</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2016-11-22T12:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: sumifs function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/313444#M263866</link>
      <description>&lt;P&gt;If the records are physically grouped by&amp;nbsp; msa_code_all/sic2/auditor_key, then this is a forward rolling window, where the window size varies, depending on the yearend and previousyear values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran this double DOW, which should be faster and take less disk space.&amp;nbsp; The ouput was identical&amp;nbsp;to the SQL program&amp;nbsp; output (with the OP's revised boundaries, and the equality constraints I mentioned elsewhere).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you expect more than 20 records in a given BY group, then increase the array sizes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want2;
  array yr{20};
  array prvyr{20};
  array sumfrq  {20};
  do rec=1 to 20;
    sumfrq{rec}=0;
  end;

  do rec=1 by 1 until (last.auditor_key);
    set have;
    by msa_code_all sic2 auditor_key  notsorted;
    yr{rec}=yearend;
    prvyr{rec}= previousyear;
    do J=rec to 1 by -1  while (prvyr{J}&amp;lt;yr{rec}&amp;lt;=yr{J});
      sumfrq{J}=sumfrq{J}+_freq_;
      end;
  end;

  do rec=1 by 1 until (last.auditor_key);
    set have;
    by msa_code_all sic2 auditor_key  notsorted;
    newvar2=sumfrq{rec};
    output;
  end;
  drop  rec yr: prvyr: sumfrq: J ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sumifs-function/m-p/313444#M263866</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2016-11-22T12:20:19Z</dc:date>
    </item>
  </channel>
</rss>

