FAILURE MAP
← Case archive

FA-11376 / Spreadsheet calculation semantics / Open access

SUMPRODUCT silently truncates mismatched ranges · case 01

A shorter range drops trailing factors, or broadcasting repeats its last value.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Zip truncation is accepted as range alignment.

VERIFIED REPAIR

Require equal range lengths before multiplying aligned entries.

Unsuccessful approach: Repeating the last short-range value creates products for cells that were never supplied.

Case contract

One-dimensional integer ranges must have equal lengths. Return pairwise product sum or #VALUE! for mismatched lengths; two empty ranges sum to zero.

Why this case matters

This isolated spreadsheet model makes cell semantics explicit; it does not claim compatibility with every workbook engine.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(a, b):
    return sum(x*y for x,y in zip(a,b))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short right range', solve([N,2],[3]), '#VALUE!')
check('short left range', solve([N],[2,3]), '#VALUE!')
check('empty right range', solve([N],[]), '#VALUE!')
check('both empty', solve([],[]), 0)
check('aligned signed products', solve([N,-2],[3,4]),3*N-8)
check('zero factor retained', solve([N,0],[0,N]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
short right range3#VALUE!Failed
short left range2#VALUE!Failed
empty right range0#VALUE!Failed
both empty00Passed
aligned signed products-5-5Passed
zero factor retained00Passed

SHA-256 / 8313972c7c31130bebcfba5b7f5820adea1f80e4c9c4d195d4352ecee440ebd2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(a, b):
    if not a or not b:
        return 0
    return sum(a[min(i,len(a)-1)] * b[min(i,len(b)-1)] for i in range(max(len(a),len(b))))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short right range', solve([N,2],[3]), '#VALUE!')
check('short left range', solve([N],[2,3]), '#VALUE!')
check('empty right range', solve([N],[]), '#VALUE!')
check('both empty', solve([],[]), 0)
check('aligned signed products', solve([N,-2],[3,4]),3*N-8)
check('zero factor retained', solve([N,0],[0,N]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
short right range9#VALUE!Failed
short left range5#VALUE!Failed
empty right range0#VALUE!Failed
both empty00Passed
aligned signed products-5-5Passed
zero factor retained00Passed

SHA-256 / 6b24519dd7ff0c89ecf3c02f93b083bacd81fa62fac84d0cbe2a67d3540d791a

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(a, b):
    return '#VALUE!' if len(a) != len(b) else sum(x*y for x,y in zip(a,b))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short right range', solve([N,2],[3]), '#VALUE!')
check('short left range', solve([N],[2,3]), '#VALUE!')
check('empty right range', solve([N],[]), '#VALUE!')
check('both empty', solve([],[]), 0)
check('aligned signed products', solve([N,-2],[3,4]),3*N-8)
check('zero factor retained', solve([N,0],[0,N]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
short right range#VALUE!#VALUE!Passed
short left range#VALUE!#VALUE!Passed
empty right range#VALUE!#VALUE!Passed
both empty00Passed
aligned signed products-5-5Passed
zero factor retained00Passed

SHA-256 / 7e5b96894320eceecfbc77a8b6f9b6d19983cff51b2917897cbfc67f19381d63

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:47.408481+00:00.

Case digest / 59e2c12c89c868cdab4a5a555b92fd68c85a7e747cc888f5ddd7e4f4e00d2012