1

I am currently at the brink of migrating our file server to a new server, unfortunately our Accounting department has made excel formulas that references alternate excel files sums in random cells.

I have a script now that recursively goes through the network files, searches for files that have extensions of XLS, XLSX, XLT... then opens them using the XLRD... then iterates through each workbook, then through each row, and each cell...

I am stuck now at what initially i thought would be the easiest part, I need to display a FORMULA not the output of the formula....

Example formula in excel:

=+-'\\FileServer1\Finance\Money\[Cash money spread.xlsx]Mar'' 14'!$N$134

When iterated in the script using XLRD: $827.00 (shows the value of the formula!!!)

Anyone have anytimes? I have the RegEx (re.sub) and all the other components except for this small (but vital) component!

Cianan Sims
  • 3,419
  • 1
  • 21
  • 30
  • see http://stackoverflow.com/questions/4690423/get-formula-from-excel-cell-with-python-xlrd – Joran Beasley Apr 02 '13 at 03:54
  • or see the newer [how to read formulas with xlrd](http://stackoverflow.com/questions/10029641/how-to-read-formulas-with-xlrd) – Anthon Apr 02 '13 at 04:01
  • @Anthon: Well, the newer one is basically a duplicate of the older one, and has a link to the older one in the comments. Actually, to be more precise, the newer one *may* be a duplicate; it might also be asking how to get the *value* of the formula, not the formula itself (which would make it a different question). This was never established. – John Y Apr 12 '13 at 21:15
  • @JohnY: maybe I should have highlighted **newer**. Both have answers from the developer of `xlrd` so a newer one is IMHO more informative, as the feature (reading formulas) might have been implemented in the mean time and the answer to the older [question](http://stackoverflow.com/questions/4690423/get-formula-from-excel-cell-with-python-xlrd) not updated. BTW AFAIK it is still not possible. – Anthon Apr 13 '13 at 04:19

0 Answers0