Skip to main content
Question

Is it possible to write to excel and preserve the formulas in one column that's in excel?


Forum|alt.badge.img

I'm working on setting up a script that reads in an Excel file. I'm merging the spreadsheet with another based on a unique column and the owner doesn't want the formulas in one column to be disturbed. They still want access to view the formula. Is it possible to write to that sheet but still preserve the formula?

4 replies

Forum|alt.badge.img+2

@rocky12 Yes you can preserve the formula. On your Excel Reader Parameters, select Read Formulas. Say you have an attribute "Sum", this will add a secondary attribute, Sum.formula. On your writer, ensure you include the Sum.formula & Sum on the writer feature type. This will preserve the formula.

Example workspace (FME 2020): excelformula.fmwt


Forum|alt.badge.img
  • Author
  • June 18, 2020
markatsafe wrote:

@rocky12 Yes you can preserve the formula. On your Excel Reader Parameters, select Read Formulas. Say you have an attribute "Sum", this will add a secondary attribute, Sum.formula. On your writer, ensure you include the Sum.formula & Sum on the writer feature type. This will preserve the formula.

Example workspace (FME 2020): excelformula.fmwt

@markatsafe where do you see read formulas. I'm working with 2019.2, is this compatible?


becchr
Influencer
Forum|alt.badge.img+25
  • Influencer
  • June 18, 2020
rocky12 wrote:

@markatsafe where do you see read formulas. I'm working with 2019.2, is this compatible?

hi @rocky12, it's in the readers parameters, right under the attributes window:


Forum|alt.badge.img
  • Author
  • June 18, 2020
markatsafe wrote:

@rocky12 Yes you can preserve the formula. On your Excel Reader Parameters, select Read Formulas. Say you have an attribute "Sum", this will add a secondary attribute, Sum.formula. On your writer, ensure you include the Sum.formula & Sum on the writer feature type. This will preserve the formula.

Example workspace (FME 2020): excelformula.fmwt

That works, and that is awesome. Thank you. Now, do you know how to move the formula around? I'm shifting the amount of columns that I have so now it's referencing different cells when it writes out...


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings