Hi: How are you "using ods" to get your results into Excel: ODS HTML, ODS MSOFFICE2K, ODS MSOFFICE2K_X or ODS TAGSETS.EXCELXP? I believe that if you use PROC PRINT and TAGSETS.EXCELXP, then the AUTO_SUBTOTALS='yes' suboption is what inserts a formula into the subtotal cell. I do not think that will work for PROC REPORT -- the internal documentation is fairly clear that it will only work with PROC PRINT and only under certain circumstances: (from the log) Auto_SubTotals: Default Value 'No' Values: yes, no, on, off. If yes, this option causes a subtotal formula to be placed in the subtotal cells on the last table row of the Print Procedure's tables. WARNING: This does not work with Sum By. It only works if the totals only happen once per table. It also does not work if the by value and the id value match. You might need to work with Tech Support to see if there is a way to insert the formula into the cell if you are using PROC REPORT and BREAK BEFORE. The issue that I see is that although TAGSETS.EXCELXP will allow you to insert a formula into a cell, you need to know the cell range in order to get the formula correct. When the subtotal is at the bottom of the group, the number of cells in the group is known (which is probably how the suboption works -- it must have an internal counter). When the subtotal is at the top of the group, the number of cells is not known. If you are NOT using TAGSETS.EXCELXP, then I'm not sure how you are getting a formula in the cell automatically with PROC PRINT. cynthia
... View more