<?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 import excel data with formulas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135600#M261015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to import data from excel that is formulated into SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A1+1&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A2+1&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A3+1&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A4+1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to copy the whole thing into SAS but for some reason column B shows grand total, am using the proc import method to import the whole excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Apr 2014 11:55:26 GMT</pubDate>
    <dc:creator>Sophie_12</dc:creator>
    <dc:date>2014-04-28T11:55:26Z</dc:date>
    <item>
      <title>import excel data with formulas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135600#M261015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to import data from excel that is formulated into SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A1+1&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A2+1&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A3+1&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =A4+1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to copy the whole thing into SAS but for some reason column B shows grand total, am using the proc import method to import the whole excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135600#M261015</guid>
      <dc:creator>Sophie_12</dc:creator>
      <dc:date>2014-04-28T11:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: import excel data with formulas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135601#M261016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;H,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes that is default behavior as far as I am aware.&amp;nbsp; The formulas are resolved by Excel on save and that is an Excel feature.&amp;nbsp; Why would you need Excel specific formula to be imported into your SAS program?&amp;nbsp; The only alternative I can think of off the top of my head is to set all your formulas to text in Excel, then import that, however the question remains, why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 12:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135601#M261016</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-04-28T12:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: import excel data with formulas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135602#M261017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Direct import only transfers values, not formulas.&lt;/P&gt;&lt;P&gt;If you want to get the formulas, you could decompress the .xlsx and then work through the .xml files in the tree.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 12:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135602#M261017</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-28T12:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: import excel data with formulas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135603#M261018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sophie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Databases like SAS do not use cell references like spreadsheets.&amp;nbsp; Each column is treated as a variable, and the formulas work on variables rather than individual cells.&amp;nbsp; Thus the SAS formula equivalent to your example is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = A + 1 ;&lt;/P&gt;&lt;P&gt;(the same for every row) and it would be part of SAS datastep following your import from Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you were to import the formulas as text, as suggested by @RW9 , all you would have is a column containing the text of the Excel formulas.&amp;nbsp; These values would have no computational significance in SAS and cannot readily be used to calculate resulting values from them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am supposing that your real world example contains much more complex formulas than the simple example you have shown, and you may want to replicate such a formula in SAS.&amp;nbsp; If that is the case you may, with perhaps some difficulty, be able to convert an Excel formula into an equivalent SAS formula.&amp;nbsp; If you care to post an example closer to your real world formula that you want to "import" and we may be able to suggest the equivalent SAS code.&amp;nbsp; Any Excel functions in your formula will need to be replaced with SAS equivalents or code to provide the same outturn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Richard Carson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 13:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135603#M261018</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-04-28T13:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: import excel data with formulas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135604#M261019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont want the formula but the values that is calculated by the formula in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg I have something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/2/13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =IF(AND(A1 &amp;lt;&amp;gt; ".",B1 &amp;lt;&amp;gt;""),"YES","NO")&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2/3/12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =IF(AND(A2 &amp;lt;&amp;gt; ".",B2 &amp;lt;&amp;gt;""),"YES","NO")&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4/5/14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Yes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =IF(AND(A3 &amp;lt;&amp;gt; ".",B 3&amp;lt;&amp;gt;""),"YES","NO")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I want to import the data with the values calculated by the formula in C which is just yes,no and yes... and I have to use the excel file in XLSX format with multiple sheets&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 01:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135604#M261019</guid>
      <dc:creator>Sophie_12</dc:creator>
      <dc:date>2014-04-29T01:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: import excel data with formulas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135605#M261020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the default SAS behaviour as specified. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's not working, then perhaps you should elaborate on your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 01:26:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135605#M261020</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-04-29T01:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: import excel data with formulas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135606#M261021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Concur with Reeza, I have put that data into and XLSX file and imported with:&lt;/P&gt;&lt;P&gt;proc import datafile="s:\temp\rob\New Microsoft Excel Worksheet.xlsx" out=tmp replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sheet="Sheet1";&lt;/P&gt;&lt;P&gt;&amp;nbsp; getnames=no;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I get a file with three columns, the last populated by 'YES' data.&amp;nbsp; This is expected operation.&amp;nbsp; In your original mail it seems to indicate you didn't want the result but the formula?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 08:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-data-with-formulas/m-p/135606#M261021</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-04-29T08:01:10Z</dc:date>
    </item>
  </channel>
</rss>

