FN-WEEKNUM-001: WEEKNUM with an invalid return_type can answer differently each time it is called
Quirk · measured · recorded 2026-11-04
The documentation says an out-of-range return_type gives #NUM!. Excel usually does, but not always, and the same call can give different answers. In recorded captures of build 20430, 479 (serial_number, return_type) pairs were read with different results: usually #NUM!, sometimes a number (0, 1, 9, 10, 53 or 54), and some pairs differ within one run file. In build 20527 a matrix of 1,926 pairs (serial_number 0, 1, 59, 60, 61 and 43831, return_type -32 to 288) was read twice in one request, and 623 pairs differed between the two readings: 619 between a number and #NUM!, and 4 between 9 and 10. Every difference has an undocumented return_type. The ten documented return_types (1, 2, 11 to 17 and 21) gave the same answer both times. No rule for the undocumented values is claimed.
Documentation: If Return_type is out of the range specified in the table above, a #NUM! error is returned. Source documentation
| Call and input route | Inputs | Excel | Correct value | Recorded in |
|---|---|---|---|---|
WEEKNUM(0, 23)cell-value2 | serial_number: 00x0000000000000000return_type: 230x4037000000000000 | #NUM! | — | Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture |
WEEKNUM(0, 23)cell-value2 | serial_number: 00x0000000000000000return_type: 230x4037000000000000 | 10x3ff0000000000000 | — | Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture |
WEEKNUM(0, 33)cell-value2 | serial_number: 00x0000000000000000return_type: 330x4040800000000000 | 00x0000000000000000 | — | Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture |
WEEKNUM(0, 33)cell-value2 | serial_number: 00x0000000000000000return_type: 330x4040800000000000 | #NUM! | — | Excel 16.0 build 20430, Windows 64-bit, CPU not recorded in this capture |
Basis: The readings conflict with each other. The 479 comes from the DnaCalc witness differences file. The 1,926 pairs come from one request of 3,852 calls, with exact input read-backs, compared pair by pair.
Open: What decides the answer for an undocumented return_type is not known.
Open: The raw readings of build 20527 are not yet in a published capture. Their counts are recorded in the DnaCalc issue tracker.
Evidence and capture sources
- DnaCalc · crates/calc-func/witness-differences.tsv 9c23dde1dfd6d93e742d763a4bad3eaec229b29c · WEEKNUM index of the conflicting readings
- DnaCalc · .beads/issues.jsonl 2d0eddcac86413014643af81d646581d54ba57bc · dc-zmk.2 the repeat comparison of 3,852 calls in build 20527
- CalcFunc-Evidence · runs/w111-date-boundaries-20260929/answers/answers-weeknum.json.gz 4d5320dfdc385354469b4d506153357bb932ab08 · date-boundary-WEEKNUM-00188
- CalcFunc-Evidence · runs/w111-date-conversion-20260929/answers/answers-weeknum.json.gz 4d5320dfdc385354469b4d506153357bb932ab08 · date-conversion-WEEKNUM-01331
- CalcFunc-Evidence · runs/w111-date-boundaries-20260929/answers/answers-weeknum.json.gz 4d5320dfdc385354469b4d506153357bb932ab08 · date-boundary-WEEKNUM-00940
- CalcFunc-Evidence · runs/w111-date-conversion-20260929/answers/answers-weeknum.json.gz 4d5320dfdc385354469b4d506153357bb932ab08 · date-conversion-WEEKNUM-00133