This is an automated email from the ASF dual-hosted git repository. jimjag pushed a commit to branch openformula in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 759dc5c7349d65c8adb5fa30cfebc5f9ca474794 Author: Jim Jagielski <[email protected]> AuthorDate: Mon Nov 16 10:26:14 2026 -0500 odf_docs: IFERROR is implemented --- odf_docs/openformula-conformance.md | 8 ++++---- odf_docs/openformula-final-report.md | 4 ++-- odf_docs/openformula-release-notes.md | 9 +++++---- odf_docs/openformula-test-gap-analysis.md | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/odf_docs/openformula-conformance.md b/odf_docs/openformula-conformance.md index ba00bb473d..448459b69a 100644 --- a/odf_docs/openformula-conformance.md +++ b/odf_docs/openformula-conformance.md @@ -11,11 +11,11 @@ Therefore **no conformance level (Small/Medium/Large) may be claimed for AOO Cal ## 2. Coverage of mandatory functions by group -The ODF 1.2 function baseline (used by AOO's own `test/aoo-test/data/openformula-functions.txt` and `test/odf-validate/openformula-functions.txt`, titled "OpenDocument 1.2 Part 2 chapter 6") lists 391 function names. AOO's opcode map (`main/formula/inc/formula/compiler.hrc`, last opcode id 410 = SKEWP) covers all of those except IFERROR, which has no opcode. IFNA (opcode 409) and SKEWP (opcode 410) were implemented in Milestone B and are no longer missing. +The ODF 1.2 function baseline (used by AOO's own `test/aoo-test/data/openformula-functions.txt` and `test/odf-validate/openformula-functions.txt`, titled "OpenDocument 1.2 Part 2 chapter 6") lists 391 function names. AOO's opcode map (`main/formula/inc/formula/compiler.hrc`, last opcode id 411 = IFERROR) covers all of those. IFNA (opcode 409) and SKEWP (opcode 410) were implemented in Milestone B, IFERROR (opcode 411) on 2026-11-16. -Every baseline function except IFERROR has an opcode, an implementation in `interpr*.cxx`, `scfuncs.src` metadata, and a `core_resource.src` name mapping (see `openformula-functions.tsv`). +Every baseline function has an opcode, an implementation in `interpr*.cxx`, `scfuncs.src` metadata, and a `core_resource.src` name mapping (see `openformula-functions.tsv`). -**[CONFIRMED 2026-11-16] IFERROR is not implemented.** `=IFERROR(7;5)` gives `#NAME?`, and an xls file that uses `_xlfn.IFERROR` loads with an unresolved name (xlsx not tested). The same run found seven more baseline names that AOO does not recognise under their ODF names: DATEDIF, FINDB, REPLACEB, SEARCHB, BINOM.DIST.RANGE, LEGACY.TDIST and ERROR.TYPE (AOO has it as ERRORTYPE). Method: AOO's ODFF function table (`FormulaOpCodeMapper`) plus its function descriptions compared with the bas [...] +**[CONFIRMED 2026-11-16] IFERROR is implemented** (6f13be1d67, Excel filters ca287e3487): a jump function like IFNA that replaces any error value; the `IFERROR.*` rows of `test/odf-validate/calcval-cases14.tsv` cover it. Before that, `=IFERROR(7;5)` gave `#NAME?`. A runtime check the same day found seven more baseline names that AOO does not recognise under their ODF names: DATEDIF, FINDB, REPLACEB, SEARCHB, BINOM.DIST.RANGE, LEGACY.TDIST and ERROR.TYPE (AOO has it as ERRORTYPE). Method: [...] **[CONFIRMED] IFNA and SKEWP are now implemented (Milestone B).** - IFNA: `SC_OPCODE_IFNA=409` in `compiler.hrc`, `ocIfna` in `opcode.hxx`, `ScInterpreter::ScIfna()` in `interpr1.cxx:392`, dispatch `case ocIfna` in `interpr4.cxx:3451`, `scfuncs.src:1027`, `core_resource.src:357`. @@ -64,7 +64,7 @@ AOO does not claim the Small Group. However, the Small Group audit (`openformula ## 7. Conformance conclusion - **Claimed conformance group: none.** AOO does not claim Small/Medium/Large. -- **Confirmed missing functions in the Small Group: none** (outside it, IFERROR is missing, see section 2). All 110 Small Group functions (§2.3.2.E) are implemented. IFNA (Large Group) and SKEWP (Medium Group) were implemented in Milestone B. +- **Confirmed missing functions in the Small Group: none.** All 110 Small Group functions (§2.3.2.E) are implemented. IFNA (Large Group) and SKEWP (Medium Group) were implemented in Milestone B. - **Confirmed semantic discrepancies vs ODF 1.4:** INDEX row-vector rule (kept as a known deviation; the Milestone A change was reverted), CONVERT `atm` (corrected in Milestone C), EASTERSUNDAY naming alias (behavior correct). - **Cannot certify any group** without runtime testing every mandatory requirement against the ODF 1.4 Part 4 normative text. diff --git a/odf_docs/openformula-final-report.md b/odf_docs/openformula-final-report.md index dc4c4acaeb..08eafe545c 100644 --- a/odf_docs/openformula-final-report.md +++ b/odf_docs/openformula-final-report.md @@ -28,7 +28,7 @@ Scope: AUDIT ONLY. No production source code was modified. No dependencies intro ### Confirmed present (FULL) — opcodes + implementation + scfuncs + core_resource mapping -All ODF 1.2 baseline functions in `test/aoo-test/data/openformula-functions.txt` have opcodes and implementations EXCEPT IFNA, SKEWP and IFERROR (IFERROR added 2026-11-16, see section 4). Notable present functions (representative, full list in `openformula-functions.tsv`): +All ODF 1.2 baseline functions in `test/aoo-test/data/openformula-functions.txt` have opcodes and implementations EXCEPT IFNA, SKEWP and IFERROR (IFERROR added 2026-11-16, see section 4; all three are implemented now). Notable present functions (representative, full list in `openformula-functions.tsv`): - Logical: AND, OR, XOR, NOT, IF, CHOOSE, TRUE, FALSE, NA. - IS*: ISBLANK, ISTEXT, ISNONTEXT, ISLOGICAL, ISREF, ISNUMBER, ISFORMULA, ISNA, ISERR, ISERROR, ISEVEN, ISODD, TYPE, CELL, N, ERROR.TYPE. @@ -91,7 +91,7 @@ AOO writes non-standard names for some functions (ODF 1.4 strict mode should use 1. **IFNA** (ODF 1.3) — absent from opcode map, interpreter, `scfuncs.src`, `core_resource.src`; only Excel-filter `ocNoName` stub (`xlformula.cxx:404`). 2. **SKEWP** (ODF 1.3) — absent from opcode map/interpreter/`scfuncs.src`/`core_resource.src`; only Excel-filter `ocNoName` stub (`xlformula.cxx:415`). Sample `SKEW` present. -3. **IFERROR** (ODF 1.2 baseline list) — no opcode, interpreter, `scfuncs.src` or `core_resource.src` entry (added 2026-11-16). +3. **IFERROR** (ODF 1.2 baseline list) — no opcode, interpreter, `scfuncs.src` or `core_resource.src` entry (added 2026-11-16). Implemented the same day as opcode 411 (6f13be1d67), with xls and xlsx support (ca287e3487). The earlier sentence here, that no other function in the ODF 1.2 baseline is missing from the opcode map, was wrong for IFERROR. A runtime check on 2026-11-16 also found DATEDIF, FINDB, REPLACEB, SEARCHB, BINOM.DIST.RANGE, LEGACY.TDIST and ERROR.TYPE (present as ERRORTYPE) not recognised under their ODF names; these are not audited further (see `openformula-conformance.md` section 2). diff --git a/odf_docs/openformula-release-notes.md b/odf_docs/openformula-release-notes.md index 0e8427fa8f..1fa873c058 100644 --- a/odf_docs/openformula-release-notes.md +++ b/odf_docs/openformula-release-notes.md @@ -5,7 +5,8 @@ As-of 2026-11-16. ## What's new - **IFNA(Value; Value_if_na)** gives you Value, unless it's `#N/A`, in which case you get `Value_if_na`. Other errors pass straight through, and Value_if_na only gets evaluated when it's needed. In an array formula, each `#N/A` in a range or array is replaced on its own. - **SKEWP** is the population version of SKEW. You'll get `Err:502` if there's only one value, or if all the values are the same. -- There are help topics now for IFNA, SKEWP, BITAND, BITOR, BITXOR, BITLSHIFT and BITRSHIFT, linked from the function lists. +- **IFERROR(Value; Alternative)** gives you Value, unless it's an error value of any kind, in which case you get Alternative. Like IFNA, Alternative only gets evaluated when it's needed, an empty cell counts as 0, and in an array formula each error is replaced on its own. +- There are help topics now for IFERROR, IFNA, SKEWP, BITAND, BITOR, BITXOR, BITLSHIFT and BITRSHIFT, linked from the function lists. ## What changed - Formulas can hold 2048 tokens now, up from 512. A 1026-character `=1+1+...` formula works (it gave Err:512 before). A function takes up to 255 arguments; with 256 or more you get `Err:512`. This was checked with `SUM`. @@ -16,10 +17,12 @@ As-of 2026-11-16. - DCOUNT and DCOUNTA without a field argument now count every matching record. Before, they could miss a record that had empty cells (the criterion `<>5` skipped a record with an empty Score), and an inline array as the database always counted 0. A row with nothing in the database columns isn't a record. ## File formats -- ODF: IFNA is saved as `of:=IFNA(...)`. +- ODF: IFNA is saved as `of:=IFNA(...)`, and IFERROR as `of:=IFERROR(...)`. - xls: IFNA and SKEWP are saved as `_xlfn.IFNA` and `_xlfn.SKEW.P` and read back fine. Before, they were lost on save and came back as `NA()`. - xlsx: we read `IFNA`, `_xlfn.IFNA`, `SKEW.P` and `_xlfn.SKEW.P`, and also `_xlfn.COUNTIFS` and `_xlfn.BAHTTEXT`. All of those gave #NAME? before. - xls: BITAND, BITOR, BITXOR, BITLSHIFT and BITRSHIFT are saved as `_xlfn.` names, and Excel calculates them. Excel used to show #NAME? for them. +- xls: IFERROR is saved as `_xlfn.IFERROR` and Excel calculates it; `_xlfn.IFERROR` written by other programs is read too. +- xlsx: we read `IFERROR`. It gave #NAME? before. - xls: IFNA with a cell reference as its first argument now works in Excel: `IFNA(A2;99)` with A2 = `NA()` gives 99. Excel used to give #N/A. - xlsx: we read `_xlfn.BITAND` and plain `BITAND`, and the same for the other four bit functions. They gave #NAME? before. @@ -29,9 +32,7 @@ As-of 2026-11-16. - A text argument typed straight into SKEW or SKEWP gives `Err:504`. ODF allows either 0 or an error here. - SKEWP of symmetric data can return a tiny leftover like 3.7E-17 instead of 0. - DCOUNT and DCOUNTA with field 0 count all the matching records instead of giving an error. An empty criteria cell is ignored, so `DCOUNT(R1:T6;"Age";W1:W2)` counts all 5 records. -- IFERROR is on the ODF 1.2 function list, but Calc doesn't have it: `=IFERROR(7;5)` gives `#NAME?`. - You can't save xlsx: the xlsx filters only import. That was already the case before these changes. ## What we haven't tested yet - Files saved by Excel itself, and xlsb. -- The function wizard's Help button. The new help topics were opened in the help window on macOS, and through the help provider on Linux. diff --git a/odf_docs/openformula-test-gap-analysis.md b/odf_docs/openformula-test-gap-analysis.md index 325254336e..6d80190551 100644 --- a/odf_docs/openformula-test-gap-analysis.md +++ b/odf_docs/openformula-test-gap-analysis.md @@ -38,7 +38,7 @@ Source-of-truth: `test/aoo-test/`, `test/odf-validate/`, and AOO source. Finding - **[CONFIRMED]** SKEWP: listed in inventories; implemented in Milestone B (`SC_OPCODE_SKEWP=410`, `ScSkewP` in `interpr3.cxx`, dispatch in `interpr4.cxx:3695`). Regression tests added to `calcval-cases14.tsv` (SKEWP.sym, SKEWP.pos, SKEWP.neg, SKEWP.vs.skew, SKEWP.one, SKEWP.zero, SKEWP.two, SKEWP.range, SKEWP.array, SKEWP.mixed, SKEWP.err). - **[CONFIRMED]** EASTERSUNDAY: implemented (`interpr2.cxx:261`) but NOT in either function inventory. No dedicated test coverage confirmed. -**[CONFIRMED] IFNA and SKEWP are no longer missing functions.** Both were implemented in Milestone B. The test inventories list them as standard ODF functions, which is now correct. IFERROR is on the same lists but is not implemented (checked 2026-11-16). +**[CONFIRMED] IFNA and SKEWP are no longer missing functions.** Both were implemented in Milestone B. The test inventories list them as standard ODF functions, which is now correct. IFERROR, on the same lists, was missing until 2026-11-16 and is implemented now; the `IFERROR.*` calcval rows cover it. ### Missing semantic tests - No confirmed semantic test for CONVERT `atm` (fixed in Milestone C: 101325.1 Pa vs old 101324.996583 Pa). @@ -82,7 +82,7 @@ Source-of-truth: `test/aoo-test/`, `test/odf-validate/`, and AOO source. Finding | Category | Gap | Severity | |----------|-----|----------| | Spec inventory | No ODF 1.3/1.4 function/operator inventory in test/ | High | -| Missing functions | IFERROR (not implemented); IFNA and SKEWP were implemented in Milestone B | Medium | +| Missing functions | None — IFNA and SKEWP implemented in Milestone B, IFERROR on 2026-11-16 | None | | Implemented but uninventoried | EASTERSUNDAY not in either test inventory | Medium | | Semantic tests | CONVERT atm (fixed Milestone C), INDEX row-vector (fixed Milestone A), DATE pre-1583, bit ops, short-circuit | High | | Parser tests | Precedence, intersection, union, quoted labels | Medium |
