You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for GETPIVOTDATA() formula (needs pivot context).
Affected entities
XLCell
XLConditionalFormat
XLNamedRange
XLDataValidation
XLTableField
Charts - somewhere far in the future
Basic concepts
Different contexts require different formulas. E.g. for cell, formula result must be a single value, while for named range it can be either a single value, or a range reference, or a collection of range references. Technically, they may be implemented as different subclasses of a single class, or by using an enum reflecting the formula type.
For the purpose of sharing formulas between entities the new repository has to be introduced (XLExpressionRepository?). It will store expression trees without relation to concrete cells or ranges. For example, two cells having formulas =SUM(A1:A2) and =SUM(D2:E18) will internally refer to the same expression SUM(*range reference nr. 1*); another cell with the formula =SUM(A1:A2)+SUM(D2:E18) will refer to another expression (SUM(*range reference nr. 1*) + SUM(*range reference nr.2*)) having no relation to the first one. (Textual representation of the expressions serves to explanation only; they must be stored in a compiled form)
Concrete instances that may use formulas (see Affected entities) hold separate instances of XLFormula (?). It includes
A reference to the shared expression (XLExpression ?)
A collection of concrete range references (A1:A2 for the cell 1, D2:E18 for the cell 2, {A1:A2, D2:E18} for the cell 3). Perhaps, the same collection must store cell references and table column references as well.
Cached computation results, a stamp of the last computation, flag NeedsRecalculation, etc. - the existing staff implemented in XLCell for caching formula values.
XLFormula must have methods allowing to dynamically construct FormulaA1 and FormulaR1C1 so they won't be stored for each cell, reducing the memory usage.
References to cells and ranges in XLFormula may be relative or absolute. When the formula is copied absolute references remain and the relative references start to refer to new ranges.
When the range is shifted formulas referring to it modify accordingly. Same when the range or entire worksheet is deleted (references become invalid - #REF!). No effort is required.
Public API most likely won't change.
Risks
Cross-workbook operations may become more complicated and require extensive testing.
The text was updated successfully, but these errors were encountered:
After Styles and Ranges handling has been improved it's time to revise formulas.
Goals:
XLCell
s by implementing the formula sharing.GETPIVOTDATA()
formula (needs pivot context).Affected entities
XLCell
XLConditionalFormat
XLNamedRange
XLDataValidation
XLTableField
Basic concepts
enum
reflecting the formula type.XLExpressionRepository
?). It will store expression trees without relation to concrete cells or ranges. For example, two cells having formulas=SUM(A1:A2)
and=SUM(D2:E18)
will internally refer to the same expressionSUM(*range reference nr. 1*)
; another cell with the formula=SUM(A1:A2)+SUM(D2:E18)
will refer to another expression (SUM(*range reference nr. 1*) + SUM(*range reference nr.2*)
) having no relation to the first one. (Textual representation of the expressions serves to explanation only; they must be stored in a compiled form)XLFormula
(?). It includesXLExpression
?)A1:A2
for the cell 1,D2:E18
for the cell 2,{A1:A2, D2:E18}
for the cell 3). Perhaps, the same collection must store cell references and table column references as well.NeedsRecalculation
, etc. - the existing staff implemented inXLCell
for caching formula values.XLFormula
must have methods allowing to dynamically constructFormulaA1
andFormulaR1C1
so they won't be stored for each cell, reducing the memory usage.XLFormula
may be relative or absolute. When the formula is copied absolute references remain and the relative references start to refer to new ranges.#REF!
). No effort is required.Risks
The text was updated successfully, but these errors were encountered: