Formulas are ignored when writing sheet. #103

Closed
christocracy wants to merge 0 commits from master into master
christocracy commented 2014-08-27 05:41:02 +00:00 (Migrated from github.com)
Implement fix as advised by @SheetJSDev https://twitter.com/christocracy/status/504469597773643776 Ran tests: all passed https://www.dropbox.com/s/b1rw0jvgy8riwoj/Screenshot%202014-08-27%2001.33.25.png?dl=0
SheetJSDev commented 2014-08-27 06:51:35 +00:00 (Migrated from github.com)

Cell values and formulae are not mutually exclusive. If you look at how Excel writes sheets, both pieces of information are included. For example, consider A1=1,A2=2,A3=A1+A2. The underlying XML for cell A3 is:

      <c r="A3">
        <f>A1+A2</f>
        <v>3</v>
      </c>

One advantage of including the value (if available) is that previewers can show the cached value without having to compute the formula.

If I understand the code correctly, if the formula and the value are present (cell.v and cell.f), it will write the formula element but not the value element. Should it write both?

Cell values and formulae are not mutually exclusive. If you look at how Excel writes sheets, both pieces of information are included. For example, consider `A1=1,A2=2,A3=A1+A2`. The underlying XML for cell A3 is: ``` <c r="A3"> <f>A1+A2</f> <v>3</v> </c> ``` One advantage of including the value (if available) is that previewers can show the cached value without having to compute the formula. If I understand the code correctly, if the formula and the value are present (`cell.v` and `cell.f`), it will write the formula element but not the value element. Should it write both?

Pull request closed

Sign in to join this conversation.
No description provided.