-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Description
When exporting to the .xlml format, formulas have their cell references in A1 format converted into RC format (i.e. $A$1 becomes R1C1) using the a1_to_rc function.
Lines 26 to 37 in 7ef3f3e
| var crefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)([1-9]\d{0,5}|10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6])(?![_.\(A-Za-z0-9])/g; | |
| var a1_to_rc =(function(){ | |
| return function a1_to_rc(fstr/*:string*/, base/*:CellAddress*/) { | |
| return fstr.replace(crefregex, function($0, $1, $2, $3, $4, $5) { | |
| var c = decode_col($3) - ($2 ? 0 : base.c); | |
| var r = decode_row($5) - ($4 ? 0 : base.r); | |
| var R = (r == 0 ? "" : !$4 ? "[" + r + "]" : (r+1)); | |
| var C = (c == 0 ? "" : !$2 ? "[" + c + "]" : (c+1)); | |
| return $1 + "R" + R + "C" + C; | |
| }); | |
| }; | |
| })(); |
The function correctly turns references with a letter followed by a number into RC format but does not convert column ranges. As a result the exported sheet either does not have these formulas or they are corrupted.
For example, SUM($A:$A) should become SUM(C1) and SUM($A:$C) should become SUM(C1:C3).
Similarly, SUM($1:$3) should become SUM(R1:R3) in the exported .xlml format.
Metadata
Metadata
Assignees
Labels
No labels