Repository navigation
MATCH/VLOOKUP/HLOOKUP with a scalar number and AGGREGATE 1-13 with values follow Excel - #2796
Harrison-Booth wants to merge 2 commits into
Conversation
…ferences MATCH, VLOOKUP and HLOOKUP return #N/A when the lookup array is a literal or computed number; AGGREGATE functions 1-13 return #VALUE! for arrays and values, as Excel does.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 seconds. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the hunk and the start of the tests: AGGREGATE with a function number 1 to 13 now returns #VALUE! when its data argument is a literal or computed value rather than a reference (Excel's behaviour), while error values still propagate. The title also promises MATCH/VLOOKUP/HLOOKUP with a scalar number; I did not read that part. Please add tests for AGGREGATE(9,6,5), AGGREGATE(14,6,5,1) (functions 14 to 19 accept arrays and values), and a scalar lookup value.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
|
Added the requested reference-form cases for AGGREGATE 9 and 14, plus a scalar MATCH case. Excel returned |
Two Excel behaviours GridCraft missed when a function gets a value where it expects a range.
Measured in Excel 16 (COM, new temporary workbook with A20=1, A21=2, closed unsaved):
MATCH(1,1),MATCH(1,1,0),MATCH(1,SUM(1))VLOOKUP(1,1,1),VLOOKUP(1,1,1,FALSE),VLOOKUP(1,SUM(1),1)HLOOKUP(1,1,1)MATCH(1,A20),VLOOKUP(1,A20,1),HLOOKUP(1,A20,1),MATCH(1,{1}),VLOOKUP(1,{1},1)AGGREGATE(1,1,1),AGGREGATE(1,6,{1,2}),AGGREGATE(9,6,1),AGGREGATE(9,6,A20*2),AGGREGATE(9,6,A20:A21*2)AGGREGATE(9,6,A20),AGGREGATE(9,6,A20:A21)AGGREGATE(14,6,{1,2},1),AGGREGATE(14,6,A20:A21*2,1)The lookup change applies to a number that is not a reference or array. Excel also gives #VALUE! for
MATCH(1,"a"); that is left as it was.LOOKUP,XMATCHandXLOOKUPaccept a scalar in Excel (all give 1) and are unchanged.SUBTOTALis not changed (Excel refuses to enterSUBTOTAL(9,1), so there is nothing to compare).Tests:
crates/functions/src/lookup.rsandcrates/calc/src/tests.rs.Not run: the Rust suite (not built on this machine;
cargo fmt --checkonly), so CI is the check. No UI change, so no other platform applies.🤖 Generated with Claude Code
Summary by CodeRabbit
AGGREGATEfunctions 1–13 now return#VALUE!when given a scalar or array instead of a cell reference. Cell references remain supported.MATCHfunctions now return#N/Awhen given a standalone numeric lookup array. Numeric cell references and arrays continue to work.