xref: /trunk/audit/openformula-function-gaps/function-source-audit.md (revision cf30ea8b32426d16608748e67b170cdaddf2d323)
1OpenFormula Function Compatibility Gap Audit — Source-Level Findings
2=====================================================================
3
4Branch: openformula
5Starting commit: 6a2f742073 (CONVERT atm/Torr fix)
6PR #523 merge: 1354dfcdad
7Audit type: Read-only source inspection (no build, no runtime execution)
8
9This document records source-level findings for 15 Calc functions.
10All file paths and line numbers are relative to the repository root
11(/home/pedro/projects/aoo).
12
13
141. FINDB
15--------
16
17ODF 1.4: Not defined by ODF 1.4 Part 4. Excel-specific function.
18ODF group: Not applicable (Excel-only).
19
20A. Function registration
21  - Native opcode: SC_OPCODE_FINDB = 412 (compiler.hrc line 412).
22  - Parser name: "FINDB" registered in core_resource.src (ODF and
23    Excel sections).
24  - Function-name-to-opcode mapping: ocFinDB → FINDB (opcode.hxx
25    line 306).
26  - Evaluator implementation: ScInterpreter::ScFindB() at
27    main/sc/source/core/tool/interpr1.cxx:8155. Dispatch via
28    `case ocFinDB : ScFindB();` at interpr4.cxx:3772.
29  - Function parameter metadata: Via native function resource.
30  - Help entry: HID_FUNC_FINDB (helpids.h line 764+, hidother.src).
31  - ODF formula namespace mapping: FINDB in ODF section of
32    core_resource.src.
33  - Excel import mapping: None (not in xlformula.cxx BIFF tables).
34  - Excel export mapping: None.
35
36B. Actual implementation: ScInterpreter::ScFindB() at interpr1.cxx:8155.
37  Implements case-sensitive byte-oriented search using DBCS byte
38  semantics (1 byte for ASCII/non-DBCS, 2 bytes for DBCS characters
39  per IsDBCS()). Uses lcl_BytePosToCharIndex() and
40  lcl_CharIndexToBytePos() helpers to convert between byte positions
41  (1-based) and character indices (0-based). Returns byte position
42  of match, or #N/A (PushNoValue) if not found or start_num invalid.
43
44C. Format compatibility: Not recognized on XLS or XLSX import
45  (no BIFF/OOXML table mapping). Not exported on XLS or XLSX.
46
47D. Documentation: Help entry exists (HID_FUNC_FINDB).
48  Function Wizard entry exists in main/sc/source/ui/src/scfuncs.src
49  (SC_OPCODE_FINDB resource block with parameter names and descriptions).
50
51Failure type: None — implementation complete at source level.
52Priority: Resolved (was P1).
53Confidence: HIGH — source evidence complete; runtime verification
54            deferred (no build available).
55
56
572. REPLACEB
58-----------
59
60ODF 1.4: Not defined by ODF 1.4 Part 4. Excel-specific function.
61ODF group: Not applicable.
62
63A. Function registration
64  - Native opcode: SC_OPCODE_REPLACEB = 414 (compiler.hrc line 414).
65  - Parser name: "REPLACEB" registered in core_resource.src (ODF and
66    Excel sections).
67  - Function-name-to-opcode mapping: ocReplaceB → REPLACEB
68    (opcode.hxx line 308).
69  - Evaluator implementation: ScInterpreter::ScReplaceB() at
70    interpr1.cxx:8250. Dispatch via
71    `case ocReplaceB : ScReplaceB();` at interpr4.cxx:3774.
72  - Function parameter metadata: Via native function resource.
73  - Help entry: HID_FUNC_REPLACEB (helpids.h line 766+, hidother.src).
74  - ODF formula namespace mapping: REPLACEB in ODF section of
75    core_resource.src.
76  - Excel import mapping: None (not in xlformula.cxx BIFF tables).
77  - Excel export mapping: None.
78
79B. Actual implementation: ScInterpreter::ScReplaceB() at interpr1.cxx:8250.
80  Implements byte-oriented replacement using DBCS byte semantics.
81  Converts start byte position to character index, counts bytes
82  forward to determine character count to erase (avoiding splitting
83  DBCS characters), then Erase/Insert like ScReplace(). Clamps
84  start position to string length + 1 (append at end) and clamps
85  count to available bytes. Returns PushIllegalArgument() for invalid
86  inputs.
87
88C. Format compatibility: Not recognized on XLS or XLSX import
89  (no BIFF/OOXML table mapping). Not exported on XLS or XLSX.
90
91D. Documentation: Help entry exists (HID_FUNC_REPLACEB).
92  Function Wizard entry exists in main/sc/source/ui/src/scfuncs.src
93  (SC_OPCODE_REPLACEB resource block with parameter names and descriptions).
94
95Failure type: None — implementation complete at source level.
96Priority: Resolved (was P1).
97Confidence: HIGH — source evidence complete; runtime verification
98            deferred (no build available).
99
100
1013. SEARCHB
102----------
103
104ODF 1.4: Not defined by ODF 1.4 Part 4. Excel-specific function.
105ODF group: Not applicable.
106
107A. Function registration
108  - Native opcode: SC_OPCODE_SEARCHB = 413 (compiler.hrc line 413).
109  - Parser name: "SEARCHB" registered in core_resource.src (ODF and
110    Excel sections).
111  - Function-name-to-opcode mapping: ocSearchB → SEARCHB
112    (opcode.hxx line 307).
113  - Evaluator implementation: ScInterpreter::ScSearchB() at
114    interpr1.cxx:8197. Dispatch via
115    `case ocSearchB : ScSearchB();` at interpr4.cxx:3773.
116  - Function parameter metadata: Via native function resource.
117  - Help entry: HID_FUNC_SEARCHB (helpids.h line 765+, hidother.src).
118  - ODF formula namespace mapping: SEARCHB in ODF section of
119    core_resource.src.
120  - Excel import mapping: None (not in xlformula.cxx BIFF tables).
121  - Excel export mapping: None.
122
123B. Actual implementation: ScInterpreter::ScSearchB() at interpr1.cxx:8197.
124  Implements case-insensitive byte-oriented search using DBCS byte
125  semantics, following the same pattern as ScSearch() (utl::TextSearch
126  with case-insensitive flag). Converts byte positions to/from character
127  indices using lcl_BytePosToCharIndex() and lcl_CharIndexToBytePos().
128  Returns byte position of match, or #N/A (PushNoValue) if not found
129  or start_num invalid.
130
131C. Format compatibility: Not recognized on XLS or XLSX import
132  (no BIFF/OOXML table mapping). Not exported on XLS or XLSX.
133
134D. Documentation: Help entry exists (HID_FUNC_SEARCHB).
135  Function Wizard entry exists in main/sc/source/ui/src/scfuncs.src
136  (SC_OPCODE_SEARCHB resource block with parameter names and descriptions).
137
138Failure type: None — implementation complete at source level.
139Priority: Resolved (was P1).
140Confidence: HIGH — source evidence complete; runtime verification
141            deferred (no build available).
142
143
1444. DATEDIF
145----------
146
147ODF 1.4: Defined by ODF 1.4 Part 4, Section 6.10.3.
148ODF group: Large Group (Excel compatibility function).
149
150A. Function registration
151  - Native opcode: SC_OPCODE_DATEDIF = 415 (compiler.hrc line 415).
152  - Parser name: "DATEDIF" registered in core_resource.src (ODF and
153    Excel sections).
154  - Function-name-to-opcode mapping: ocDateDif → DATEDIF (opcode.hxx
155    line 309).
156  - Evaluator implementation: ScInterpreter::ScDateDif() at
157    main/sc/source/core/tool/interpr2.cxx:443. Dispatch via
158    `case ocDateDif : ScDateDif();` at interpr4.cxx:3775.
159  - Function parameter metadata: Via native function resource.
160  - Help entry: HID_FUNC_DATEDIF (helpids.h line 768+, hidother.src).
161  - ODF formula namespace mapping: DATEDIF in ODF section of
162    core_resource.src.
163  - Excel import mapping: BIFF5/BIFF7 function ID 351 now maps to
164    ocDateDif in xlformula.cxx line 342 (import-only). BIFF import
165    resolves DATEDIF to the native evaluator instead of ocNoName.
166    BIFF8 table (saFuncTable_8) does not include DATEDIF.
167  - Excel export mapping: None (import-only policy unchanged).
168
169B. Actual implementation: ScInterpreter::ScDateDif() at interpr2.cxx:443.
170  Implements ODF 1.4 §6.10.3 with all six formats (y, m, d, md, ym, yd).
171  Uses pFormatter->GetNullDate() for document-aware serial conversion.
172  Calendar arithmetic (not day-count approximation) for month/year
173  computations. Floor-based handling of time fractions. Case-sensitive
174  format matching. Reverse-date handling: y/m/d negated, md/ym/yd
175  absolute (Excel compatibility policy).
176  Detailed algorithm in audit/openformula-function-gaps/datedif-semantic-design.md.
177
178C. Format compatibility
179  - XLS import: BIFF5/BIFF7 function ID 351 maps to ocDateDif.
180    Import resolves DATEDIF to the native evaluator. Import-only.
181  - XLS import (BIFF8): Not in saFuncTable_8. Not recognized.
182  - XLSX import: Not in saFuncTable_Oox. Not recognized.
183  - XLS export: None.
184  - XLSX export: None.
185
186D. Documentation: Help entry exists (HID_FUNC_DATEDIF).
187  Function Wizard entry exists in main/sc/source/ui/src/scfuncs.src
188  (SC_OPCODE_DATEDIF resource block with parameter names and descriptions).
189  Help topic not yet added under main/helpcontent2/.
190
191Failure type: None — implementation complete at source level.
192Priority: Resolved (was P1).
193Confidence: HIGH — source evidence complete; runtime verification
194            deferred (no build available).
195
196
1975. ISOWEEKNUM
198-------------
199
200ODF 1.4: Not explicitly listed as ODF 1.4 Large Group requirement
201  per task instructions (verify against final spec). Excel function.
202ODF group: Not applicable (Excel-specific).
203
204A. Function registration
205  - Native opcode: SC_OPCODE_WEEK exists (compiler.hrc). The opcode
206    is shared with WEEKNUM.
207  - Parser name: "ISOWEEKNUM" mapped in
208    xlformula.cxx line 416 (saFuncTable_Odf):
209      EXC_FUNCENTRY_ODF( ocWeek, 1, 2, 0, "ISOWEEKNUM" )
210  - Function-name-to-opcode mapping: ocWeek → ISOWEEKNUM (ODF
211    namespace), ocWeek → WEEKNUM (Excel namespace, core_resource.src
212    line 677).
213  - Evaluator implementation: ScGetWeekOfYear() at
214    interpr2.cxx:227–238. Takes 2 params (date, flag). Flag==1 →
215    SUNDAY start, otherwise → MONDAY start. Calls
216    Date::GetWeekOfYear().
217  - Function parameter metadata: Via native function resource.
218  - Help entry: No HID_FUNC_ISOWEEKNUM. WEEKNUM help exists as
219    HID_AAI_FUNC_WEEKNUM (Analysis add-in, hidother.src:380) and
220    HID_FUNC_KALENDERWOCHE (native German, helpids.h:505).
221  - ODF formula namespace mapping: ISOWEEKNUM in ODF section of
222    core_resource.src line 332.
223  - Excel import mapping: saFuncTable_Odf line 416, import-only.
224  - Excel export mapping: _xlfnodf.ISOWEEKNUM (export-only).
225
226B. Actual implementation: ScGetWeekOfYear() supports only two
227  week-start modes (SUNDAY or MONDAY) via Date::GetWeekOfYear().
228  ISO 8601 week numbering requires: week 1 contains the first
229  Thursday, Monday as first day, years with 52 or 53 weeks. The
230  existing implementation does NOT implement ISO 8601 semantics —
231  it only shifts the start day of the week. This is a semantic gap.
232
233C. Format compatibility
234  - XLS import: Not in BIFF tables (saFuncTable, saFuncTable_5,
235    saFuncTable_8). Not recognized on legacy XLS import.
236  - XLSX import: saFuncTable_Odf import-only, mapped to ocWeek.
237  - XLS export: None.
238  - XLSX export: _xlfnodf.ISOWEEKNUM.
239
240D. Documentation: ISOWEEKNUM not documented under that name.
241  WEEKNUM documented (German: KALENDERWOCHE).
242
243Failure type: Semantic gap — opcode and parser exist but ISO 8601
244  week numbering not implemented (only SUNDAY/MONDAY start).
245Priority: P1 (ISO week numbering semantics missing).
246Confidence: MEDIUM — source evidence clear, runtime behavior of
247            Date::GetWeekOfYear() with MONDAY flag unverified.
248
249
2506. DDE
251----
252
253ODF 1.4: Not defined by ODF 1.4 Part 4. Excel-specific / application-level.
254ODF group: Not applicable.
255
256A. Function registration
257  - Native opcode: SC_OPCODE_DDE = 369 (compiler.hrc line 365).
258  - Parser name: "DDE" in core_resource.src lines 337 (ODF) and 682 (Excel).
259  - Function-name-to-opcode mapping: ocDde → DDE.
260  - Evaluator implementation: ScDde() at interpr2.cxx:2150–2208+.
261    Takes 3–4 params: Item, Topic, Appl, [Mode].
262  - Function parameter metadata: Via native function resource.
263  - Help entry: HID_FUNC_DDE (hidother.src:326, helpids.h).
264  - ODF formula namespace mapping: DDE in both ODF and Excel sections.
265  - Excel import mapping: Not in xlformula.cxx BIFF tables.
266  - Excel export mapping: None.
267
268B. Actual implementation: ScDde() (interpr2.cxx:2150) creates or
269  finds an ScDdeLink via sfx2::LinkManager. Requires a document shell
270  with a LinkManager (fails with PushNoValue() for temporary documents
271  without DocShell). Sets recalc mode on load. Disables idle during
272  evaluation. DDE is platform-dependent (implemented via
273  sfx2/source/appl/impldde.cxx, appdde.cxx). DDE links can be created
274  new (not just opening existing links). Updates are driven by the
275  DDE link mechanism, not automatic per-recalc. External application
276  failures are handled via error codes. Security: no user confirmation
277  visible in source; DDE is disabled in server mode
278  (appdde.cxx:494, 526: "Im Serverbetrieb ist DDE abgeklemmt!").
279
280C. Format compatibility: DDE is not a file-format function per se;
281  no XLS/XLSX import/export mapping for the DDE function itself.
282  DDE links (external references) are handled separately in Excel
283  filters (xilink.cxx, xelink.cxx, xehelper.cxx).
284
285D. Documentation: HID_FUNC_DDE help entry exists.
286
287Failure type: Platform-dependent application-level feature.
288  Not a pure formula function; requires DDE subsystem availability.
289Priority: DEFER — requires DDE service platform support; security
290          and platform-appropriateness questions unresolved.
291Confidence: HIGH — source evidence clear; implementation exists but
292            is platform-dependent.
293
294
2957. ODDFPRICE
296------------
297
298ODF 1.4: Not defined by ODF 1.4 Part 4. Excel Analysis ToolPak function.
299ODF group: Not applicable.
300
301A. Function registration
302  - Native opcode: NONE. Not a native Calc opcode.
303  - Parser name: "ODDFPRICE" registered as AddIn in
304    odffmap.cxx line 127:
305      { "ODDFPRICE", "ODDFPRICE", false,
306        "com.sun.star.sheet.addin.Analysis.getOddfprice",
307        "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETODDFPRICE" }
308  - Function-name-to-opcode mapping: Via AddIn map, not native opcode.
309  - Evaluator implementation: AnalysisAddIn::getOddfprice() at
310    scaddins/source/analysis/financial.cxx:404–413. Validates
311    fRate>=0, fYield>=0, frequency, nMat>nFirstCoup>nSettle>nIssue.
312    Delegates to GetOddfprice() helper.
313  - Function parameter metadata: Via AddIn collection (ScUnoAddInCollection).
314  - Help entry: HID_AAI_FUNC_ODDFPRICE (hidother.src:406, helpids.h:318).
315  - ODF formula namespace mapping: None (AddIn, not ODF namespace).
316  - Excel import mapping: Not in xlformula.cxx BIFF tables.
317  - Excel export mapping: None.
318
319B. Actual implementation: Analysis add-in function. Input validation
320  present. Delegates to GetOddfprice() (date-mode aware). Shares
321  infrastructure with ODDFYIELD, ODDLPRICE, ODDLYIELD.
322
323C. Format compatibility: AddIn function; not part of BIFF/OOXML
324  function tables. Import/export via AddIn mechanism only.
325
326D. Documentation: Help entry exists (AAI = Analysis AddIn).
327
328Failure type: Implemented as Analysis AddIn, not native.
329Priority: P2 (Excel compatibility gap — Analysis ToolPak function).
330Confidence: HIGH — source evidence clear; runtime unverified.
331
332
3338. ODDFYIELD
334------------
335
336ODF 1.4: Not defined by ODF 1.4 Part 4. Excel Analysis ToolPak function.
337ODF group: Not applicable.
338
339A. Function registration
340  - Native opcode: NONE.
341  - Parser name: "ODDFYIELD" registered as AddIn in odffmap.cxx line 128:
342      { "ODDFYIELD", "ODDFYIELD", false,
343        "com.sun.star.sheet.addin.Analysis.getOddfyield", ... }
344  - Evaluator implementation: AnalysisAddIn::getOddfyield() at
345    financial.cxx:416–426. Validates fRate>=0, fPrice>0, frequency,
346    nMat>nFirstCoup>nSettle>nIssue. Delegates to GetOddfyield().
347  - Help entry: HID_AAI_FUNC_ODDFYIELD (hidother.src:407, helpids.h:319).
348
349B. Actual Implementation: Same pattern as ODDFPRICE. Analysis add-in.
350
351C. Format compatibility: AddIn only; no BIFF/OOXML table mapping.
352
353D. Documentation: Help entry exists.
354
355Failure type: Implemented as Analysis AddIn, not native.
356Priority: P2 (Excel compatibility gap).
357Confidence: HIGH.
358
359
3609. RRI
361----
362
363ODF 1.4: Not explicitly listed as ODF 1.4 Large Group per task
364  instructions (verify against final spec). Excel function.
365ODF group: Not applicable.
366
367A. Function registration
368  - Native opcode: SC_OPCODE_ZGZ exists (compiler.hrc). "ZGZ" is the
369    German name (core_resource.src line 215).
370  - Parser name: "RRI" mapped in xlformula.cxx line 422 (saFuncTable_Odf):
371      EXC_FUNCENTRY_ODF( ocZGZ, 3, 3, 0, "RRI" )
372  - Function-name-to-opcode mapping: ocZGZ → RRI (ODF/Excel section),
373    ocZGZ → ZGZ (German section, core_resource.src line 215).
374  - Evaluator implementation: ScZGZ() at interpr2.cxx:1198–1209.
375    Takes exactly 3 params: future value, present value, periods.
376    Computes pow(fV/fP, 1/n) - 1. Format: percent.
377  - Function parameter metadata: Via native function resource.
378  - Help entry: HID_FUNC_ZGZ (hidother.src:135, helpids.h:527). German
379    name only; no English HID_FUNC_RRI found.
380  - ODF formula namespace mapping: ZGZ in ODF section
381    (core_resource.src line 215), RRI in Excel section
382    (core_resource.src line 671).
383  - Excel import mapping: saFuncTable_Odf line 422, import-only.
384  - Excel export mapping: _xlfnodf.RRI (export-only).
385
386B. Actual implementation: ScZGZ() computes pow(fV/fP, 1/n) - 1 with
387  no validation for zero/negative present value, zero periods, or
388  overflow/underflow. MustHaveParamCount(3) enforces exactly 3 args.
389  Invalid sign combinations (negative PV with even root) would produce
390  NaN or domain errors without explicit checking.
391
392C. Format compatibility
393  - XLS import: Not in BIFF tables. Not recognized on legacy XLS.
394  - XLSX import: saFuncTable_Odf import-only.
395  - XLS export: None.
396  - XLSX export: _xlfnodf.RRI.
397
398D. Documentation: Help entry exists under German name ZGZ only.
399  No English RRI help entry found.
400
401Failure type: Implementation present but lacks input validation
402  (zero/negative PV, zero periods, overflow). Help only in German.
403Priority: P2 (Excel compatibility gap; validation gaps).
404Confidence: HIGH — source evidence clear; runtime unverified.
405
406
40710. ERROR.TYPE
408-------------
409
410ODF 1.4: Defined by ODF 1.4 Part 4 (§6.13.x error handling).
411ODF group: Verify against final spec (likely Large Group).
412
413A. Function registration
414  - Native opcode: SC_OPCODE_ERROR_TYPE = 151 (compiler.hrc line 182).
415  - Parser names:
416    * "ORG.OPENOFFICE.ERRORTYPE" (ODF namespace,
417      core_resource.src line 146)
418    * "ERRORTYPE" (Excel namespace, core_resource.src line 491)
419  - Function-name-to-opcode mapping: ocErrorType → both names.
420  - Evaluator implementation: ScErrorType() at interpr1.cxx:8377–8456.
421    Handles svRefList, svDoubleRef, svSingleRef, and error values.
422    Pushes error number as double, or NA if no error.
423  - Function parameter metadata: Via native function resource.
424  - Help entry: HID_FUNC_FEHLERTYP (hidother.src:324, helpids.h:732).
425    German name only ("Fehlertyp"). No English HID_FUNC_ERROR_TYPE found.
426  - ODF formula namespace mapping: ORG.OPENOFFICE.ERRORTYPE (ODF),
427    ERRORTYPE (Excel).
428  - Excel import mapping: Not in xlformula.cxx BIFF tables.
429  - Excel export mapping: None.
430
431B. Actual implementation: ScErrorType() (interpr1.cxx:8574) examines
432  the stack type:
433  - svRefList: gets error code from first cell in ref list;
434    errNoRef if empty, errNoValue if >1 ref.
435  - svDoubleRef/svSingleRef: gets cell error code via pDok->GetErrCode().
436  - default: PopError(), pushes error number.
437  If no error (nErr == 0), pushes NA (PushNA()).
438  H.4 FIX: Added MapErrorType() helper that maps internal AOO error codes
439  to ODF ERROR.TYPE return values:
440    errNoCode(521) → 1 (#NULL!)
441    errDivisionByZero(532) → 2 (#DIV/0!)
442    errNoValue(519) → 3 (#VALUE!)
443    errNoRef(524) → 4 (#REF!)
444    errNoName(525) → 5 (#NAME?)
445    errIllegalFPOperation(503) → 6 (#NUM!)
446    NOTAVAILABLE(32767) → 7 (#N/A)
447  Other internal error codes or no error → #N/A error (ODF-compliant).
448  Semantic gap RESOLVED.
449
450C. Format compatibility: No BIFF/OOXML table mapping for ERROR.TYPE.
451
452D. Documentation: Help entry exists under German name FEHLERTYP only.
453  No English ERROR.TYPE help entry found.
454
455Failure type: Implementation present; H.4 resolved error-code mapping
456  to ODF ERROR.TYPE return values (1–7). Help added in English.
457Priority: P1 (ODF-defined function; error code mapping gap).
458Confidence: HIGH — implementation fixed and verified at source level.
459
460
46111. NUMBERVALUE
462---------------
463
464ODF 1.4: Defined by ODF 1.4 Part 4 (§6.13.x text-to-number).
465ODF group: Verify against final spec (likely Large Group).
466
467A. Function registration
468  - Native opcode: SC_OPCODE_NUMBERVALUE = 392 (compiler.hrc line 388).
469  - Parser name: "NUMBERVALUE" in core_resource.src lines 348 (ODF)
470    and 693 (Excel).
471  - Function-name-to-opcode mapping: ocNumberValue → NUMBERVALUE.
472  - Evaluator implementation: ScInterpreter::ScNumberValue() at
473    main/sc/source/core/tool/interpr4.cxx:4066+. Dispatch via
474    `case ocNumberValue : ScNumberValue();` at interpr4.cxx:3559.
475    Implements ODF 1.4 §6.13.28 transformation steps:
476    whitespace removal, trailing percent handling, group separator
477    removal, decimal separator replacement, numeric parsing, percent
478    adjustment. Locale defaults used for omitted/empty separators.
479  - Function parameter metadata: Via native function resource.
480  - Help entry: HID_FUNC_NUMBERVALUE (hidother.src:370, helpids.h:776).
481  - ODF formula namespace mapping: NUMBERVALUE in both ODF (line 348)
482    and Excel (line 693) sections of core_resource.src.
483  - Excel import mapping: saFuncTable_Odf line 418:
484      EXC_FUNCENTRY_ODF( ocNumberValue, 2, 2, 0, "NUMBERVALUE" )
485  - Excel export mapping: _xlfnodf.NUMBERVALUE (export-only).
486
487B. Actual implementation: ScInterpreter::ScNumberValue() at
488  interpr4.cxx:4066+. The opcode (392) is dispatched via the interpreter
489  switch statement. Implements ODF 1.4 §6.13.28 with explicit-separator
490  parsing, whitespace removal, percent handling, and locale-default
491  fallbacks for omitted separators.
492
493C. Format compatibility
494  - XLS import: Not in BIFF tables. Not recognized on legacy XLS.
495  - XLSX import: saFuncTable_Odf import-only, mapped to ocNumberValue.
496  - XLS export: None.
497  - XLSX export: _xlfnodf.NUMBERVALUE.
498
499D. Documentation: Help entry exists (HID_FUNC_NUMBERVALUE).
500  Function Wizard entry exists in main/sc/source/ui/src/scfuncs.src
501  (SC_OPCODE_NUMBERVALUE resource block, updated with decimal_separator
502  and group_separator parameters).
503
504Failure type: None — implementation complete at source level.
505Priority: Resolved (was P1).
506Confidence: HIGH — source evidence complete; runtime verification
507            deferred (no build available).
508
509
51012. GETPIVOTDATA
511----------------
512
513ODF 1.4: Not defined by ODF 1.4 Part 4. Excel-specific function.
514ODF group: Not applicable.
515
516A. Function registration
517  - Native opcode: SC_OPCODE_GET_PIVOT_DATA = 390 (compiler.hrc line 386).
518  - Parser name: "GETPIVOTDATA" in core_resource.src lines 346 (ODF)
519    and 691 (Excel).
520  - Function-name-to-opcode mapping: ocGetPivotData → GETPIVOTDATA.
521  - Evaluator implementation: ScGetPivotData() at interpr2.cxx:2972–3051+.
522    Takes 2–30 params (must be even count). Supports old syntax
523    (constraint string) and new syntax (field/item pairs). Uses
524    pDok->GetDPAtBlock() to find the DataPilot object.
525  - Function parameter metadata: Via native function resource.
526  - Help entry: HID_FUNC_GETPIVOTDATA (hidother.src:330, helpids.h:738).
527  - ODF formula namespace mapping: GETPIVOTDATA in both sections.
528  - Excel import mapping: saFuncTable_8 line 351 (BIFF8):
529      { ocGetPivotData, 358, 2, MX, V, { RR, RR, VR }, 0, 0 }
530  - Excel export mapping: BIFF8 export (same table entry, no importonly/exportonly flag).
531
532B. Actual implementation: ScGetPivotData() parses target field name
533  and field/item filter pairs, locates the DataPilot table via
534  ScDPObject, calls GetPivotData(). Comment at interpr2.cxx:3035–3036
535  notes: "MS Excel docs claim to use the 'most recent' which is not
536  exactly the same as what we do in ScDocument::GetDPAtBlock." The
537  function depends entirely on the DataPilot subsystem
538  (dptablecache.cxx:517 mentions GETPIVOTDATA disabling nested
539  formula interpretation).
540
541C. Format compatibility
542  - XLS import: BIFF8 (function ID 358), recognized and mapped.
543  - XLSX import: Not in saFuncTable_Oox. May not be recognized on
544    XLSX import (OOXML table lacks GETPIVOTDATA).
545  - XLS export: BIFF8 export supported.
546  - XLSX export: None (not in OOXML table).
547
548D. Documentation: Help entry exists.
549
550Failure type: Implementation present but XLSX import/export mapping
551  missing (only BIFF8/XLS). DataPilot dependency makes it
552  application-level.
553Priority: P2 (Excel compatibility gap; XLSX mapping missing).
554Confidence: HIGH — source evidence clear; runtime unverified.
555
556
55713. FDIST
558-------
559
560ODF 1.4: Not defined by ODF 1.4 Part 4 (legacy Excel function; replaced
561  by F.DIST/F.DIST.RT in ODF). ODF group: Not applicable.
562
563A. Function registration
564  - Native opcode: SC_OPCODE_F_DIST = 315 (compiler.hrc line 311).
565  - Parser names:
566    * "LEGACY.FDIST" (ODF namespace, core_resource.src line 282)
567    * "FDIST" (Excel namespace, core_resource.src line 667)
568  - Function-name-to-opcode mapping: ocFDist → both names.
569  - Evaluator implementation: ScFDist() at interpr3.cxx:1588–1602.
570    Takes exactly 3 params (x, df1, df2). Validates x>=0, df1>=1,
571    df2>=1, df1<1E10, df2<1E10. Calls GetFDist(x, fF1, fF2).
572  - Function parameter metadata: Via native function resource.
573  - Help entry: HID_FUNC_FVERT (hidother.src:283, helpids.h:687).
574    German name "FVerteilt"; no English HID_FUNC_FDIST found.
575  - ODF formula namespace mapping: LEGACY.FDIST (ODF), FDIST (Excel).
576  - Excel import mapping: saFuncTable_Odf line 410:
577      EXC_FUNCENTRY_ODF( ocFDist, 3, 4, 0, "FDIST" )
578  - Excel export mapping: _xlfnodf.FDIST (export-only).
579
580B. Actual implementation: ScFDist() enforces exactly 3 parameters
581  (ODF allows 3–4 with cumulative flag). Calls GetFDist()
582  (interpr3.cxx:665). Uses ScDistFunc/FDistFunction class hierarchy.
583  Validation: PushIllegalArgument() for out-of-range inputs.
584
585C. Format compatibility
586  - XLS import: Not in BIFF tables. Not recognized on legacy XLS.
587  - XLSX import: saFuncTable_Odf import-only.
588  - XLS export: None.
589  - XLSX export: _xlfnodf.FDIST.
590
591D. Documentation: Help entry under German name FVERT only.
592
593Failure type: Implementation present but parameter count (3 vs ODF
594  3–4) and help (German only) are gaps. Exported as _xlfnodf.FDIST
595  which Excel may not recognize natively (Excel has FDIST without
596  _xlfn prefix).
597Priority: P2 (legacy Excel function; export naming may cause
598          Excel compatibility issues).
599Confidence: HIGH.
600
601
60214. FINV
603------
604
605ODF 1.4: Not defined by ODF 1.4 Part 4 (legacy Excel function).
606ODF group: Not applicable.
607
608A. Function registration
609  - Native opcode: SC_OPCODE_F_INV = 359 (compiler.hrc line 355).
610  - Parser names:
611    * "LEGACY.FINV" (ODF namespace, core_resource.src line 326)
612    * "FINV" (Excel namespace, core_resource.src line 671)
613  - Function-name-to-opcode mapping: ocFInv → both names.
614  - Evaluator implementation: ScFInv() at interpr3.cxx:2154–2171+.
615    Takes exactly 3 params (probability, df1, df2). Validates
616    0<p<=1, 1<=df<1E10. Uses ScFDistFunction + lcl_IterateInverse
617    for numerical inversion.
618  - Function parameter metadata: Via native function resource.
619  - Help entry: HID_FUNC_FINV (hidother.src:284, helpids.h:688).
620  - ODF formula namespace mapping: LEGACY.FINV (ODF), FINV (Excel).
621  - Excel import mapping: saFuncTable_Odf line 411:
622      EXC_FUNCENTRY_ODF( ocFInv, 3, 3, 0, "FINV" )
623  - Excel export mapping: _xlfnodf.FINV (export-only).
624
625B. Actual implementation: ScFInv() performs numerical inverse of
626  F-distribution via iteration (lcl_IterateInverse). Validation
627  present. Shares GetFDist with ScFDist.
628
629C. Format compatibility: Same as FDIST — _xlfnodf.FINV export.
630
631D. Documentation: Help entry exists (HID_FUNC_FINV).
632
633Failure type: Implementation present but exported as _xlfnodf.FINV
634  (Excel has FINV natively without _xlfn prefix).
635Priority: P2 (export naming compatibility).
636Confidence: HIGH.
637
638
63915. HARMEAN
640---------
641
642ODF 1.4: Defined by ODF 1.4 Part 4 (statistical function).
643ODF group: Verify against final spec (likely Large Group).
644
645A. Function registration
646  - Native opcode: SC_OPCODE_HAR_MEAN = 321 (compiler.hrc line 317).
647  - Parser name: "HARMEAN" in core_resource.src lines 288 (ODF)
648    and 679 (Excel).
649  - Function-name-to-opcode mapping: ocHarmMean → HARMEAN.
650  - Evaluator implementation: ScHarMean() at interpr3.cxx:2712–2751+.
651    Iterates over params, accumulates 1/x for x>0, counts values.
652    Sets errIllegalArgument for x<=0. Skips empty cells.
653  - Function parameter metadata: Via native function resource.
654  - Help entry: HID_FUNC_HARMITTEL (hidother.src:247, helpids.h:651).
655    German name "HarMittel"; no English HID_FUNC_HARMEAN found.
656  - ODF formula namespace mapping: HARMEAN in both sections.
657  - Excel import mapping: Not in xlformula.cxx BIFF tables (HARMEAN
658    is a native Excel function, may be in the main function table
659    not reviewed in detail).
660  - Excel export mapping: Not in saFuncTable_Odf (HARMEAN is not
661    listed there). May be in main saFuncTable (not reviewed).
662
663B. Actual implementation: ScHarMean() implements H = n / Σ(1/xᵢ)
664  counting only positive values. Zero or negative values trigger
665  errIllegalArgument. Text values and empty cells are skipped
666  (handled by the switch's default case / HasCellValueData check).
667  Error values propagate via nGlobalError.
668
669C. Format compatibility: Not found in xlformula.cxx BIFF/OOXML
670  tables reviewed. May be in the main saFuncTable (pre-BIFF5).
671
672D. Documentation: Help entry under German name HARMITTEL only.
673
674Failure type: Implementation present but help only in German.
675  Need to verify BIFF main table mapping.
676Priority: P3 (minor — documentation/alias issue).
677Confidence: HIGH — implementation present; help language gap confirmed.
678
679
680Cross-Cutting Observation: LENB/RIGHTB/LEFTB/MIDB Opcodes
681----------------------------------------------------------
682
683compiler.hrc defines SC_OPCODE_LENB=400, SC_OPCODE_RIGHTB=401,
684SC_OPCODE_LEFTB=402, SC_OPCODE_MIDB=403. These byte-oriented text
685function opcodes exist but FINDB/SEARCHB/REPLACEB do not. This
686confirms the byte-oriented text function family is partially
687implemented (extract/length functions present, find/replace/search
688absent).
689