ADR 0043 - Excel-native preference principle
- Status: process-normative
- Date: 2026-05-18
- Spec target: XTL 0.x (process)
- Affects: future function / directive additions; ADR governance pipeline; retroactive notes on ADR-0003 (TEXT format table), ADR-0019 amendment (date arithmetic), ADR-0039 (HYPERLINK), and the XTL function surface as a whole
Status note. This ADR was first labeled
informationalbecause it does not change runtime behavior, then briefly relabeledacceptedto reflect its MUST obligations on future ADR authors. After the 2026-05-18 reviewer pass, ADR template0000-template.mdgained a fifth status —process-normative— for exactly this case: accepted and binding on future ADR authors, but not on runtime impl. ADR-0034 stays informational because it carries only SHOULD-level obligations; this ADR's process gate is stricter.
Context
The XTL function and directive surface has grown additively since 0.1 draft. The Excel template-engine genre (JXLS, xltpl, etc.) has a well-stocked function catalog, and the temptation when comparing surfaces is to add whatever the prior art has. ADR-0034 named this temptation and proposed three corollaries; this ADR adds a fourth.
A late audit of the existing surface — driven by the maintainer
asking "isn't TEXT() for visual formatting just doing what cell
numFmt already does?" — surfaced that several functions XTL
ships have a redundant Excel-formula path the author can take
instead:
- Visual cell formatting → cell
numFmt - Static hyperlinks →
=HYPERLINK("...", "...")Excel formula - Per-row date component extraction (output cell) →
=YEAR(B2)Excel formula - String case conversion (output cell) →
=UPPER(B2)Excel formula
The reference impl's renderer preserves cell formulas verbatim
when no {{ ... }} substitution applies, so an Excel formula
authored in the template cell stays a formula in the output. Excel
re-calculates at open time. No XTL function call needed.
The question this ADR settles: when is a new XTL function warranted?
Principle
A new XTL function or directive is warranted only when its evaluation must happen before rendering — i.e., during data shaping, group keying, filter / sort /
__inputs__evaluation, or output-filename composition.If the same computation can be done by an Excel formula in the output cell — and the result only matters at workbook-display time — XTL must not duplicate it. The author writes the formula directly; the renderer preserves it; Excel evaluates at open.
The principle is a gate on additions. It does not retroactively remove anything (0.x compatibility), but it does:
- Provide a normative test for every future "should we add X?" ADR — see "How to apply" below.
- Document the intended boundary so authors and porters understand which path to take.
- Surface the cases where an existing XTL function is the only path versus where it overlaps an Excel-native path.