DATA Step, Macro, Functions and more

Excel calculations through SAS

Frequent Contributor
Posts: 142

Excel calculations through SAS


I have an excel sheet with calculations which needs to be implemented through SAS to automate the report. Please find the attchment for the sample excel sheet. I want to get the field2 values as shown in the excel template using sas code. For example field2 first value is getting generated by calculating column values i.e. (C10+D11+E12+F13+G14+H15+I16+J17+K18+L19+M20+N21). So i want to implement these calculations using sas. Can anyone suggest on this.


Valued Guide
Posts: 653

Re: Excel calculations through SAS

It sounds like you want to embed the formula into the worksheet so that it will be active.  This can be accomplished using the Output Delivery System, ODS.  There have been a number of papers written on the topic.  Try google: sas ods excel formula

Valued Guide
Posts: 2,191

Re: Excel calculations through SAS

Art's suggestion is right on the money, for straightforward calculations, like a difference column.

The formulas in the FIELD2 row in your "sample.xls" are just column totals, but your message seeks the total along the diagonal for the first FIELD2 cell. What plan have you for the next FIELD2 cells?

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation