I am aware that in 2008 the method of exporting formula to excel was downgraded [see here](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ddf2f19d-3f70-4bb0-a035-00709ffee2f9/excel-formulas-in-ssrs-2008?forum=sqlreportingservices).

But I have seen a workaround for a static formula where the same formula is required (see [Here](https://stackoverflow.com/questions/19584986/ssrs-report-export-to-excel-formulas) and [here](https://stackoverflow.com/questions/31000303/how-to-insert-excel-formula-to-cell-in-report-builder-3-0)). However I have the case where I need a relative formula when I export to excel. Is there a newer solution out there does anyone know?

This is my workings so far
The result I am after is cell `(T,r3) = cell (R,r3)-cell(O,r3)` and then `cell (T,r4) = cell (R,r4)-cell(O,r4)` and so on in excel I would expect to see
in cell `T3 the formula =R3-O3`
and cell `T4 the formula =R4-O4`

```
      O!P!Q!R !S!T!
r3  1    5   N   5           4  
r4  3    5   N   10          7  

```

(Sorry I can not get the table to line up)

my ssrs expression is 

```
="=R"+cstr(RowNumber("DataSet1")+2)+"-O"+cstr(RowNumber("DataSet1")+2) 

```

where DataSet1 is what my ssrs tablix is based on and the +2 element is to offset to allow how the titles of the report and the table move the first row of data down the excel sheet.

The output is achieve in the cells when exported to excel is the formula as text in the cell content and if I click into the cell and press backspace and return the formula works. It appears that some white space is being exported or excel just treats every thing as text on the import routine

I can of course use and find and replace on this statement in excel

`="=R"+cstr(RowNumber("DataSet1")+2)+"-O"+cstr(RowNumber("DataSet1")+2)` as suggested but was trying to be more elegant

I do not suppose you can export some code to run in excel as vba to do the find and replace function at a button press for the user?

Has anyone any suggestions - thanks

Ian