Fix approximate lookup type compatibility - #1755
Conversation
|
@Tobiadefami thanks for the pull request. No CLA step needed here — our records show you signed the Contributor License Agreement on 2026-07-31. That signature came from our previous signing form and has been carried over, so there is nothing for you to re-sign. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 964a43e | Commit Preview URL Branch Preview URL |
Aug 28 2026, 11:11 PM |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5281986. Configure here.
Performance comparison of head (964a43e) vs base (114fd5d) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1755 +/- ##
========================================
Coverage 97.32% 97.33%
========================================
Files 195 195
Lines 15739 15740 +1
Branches 3390 3385 -5
========================================
+ Hits 15318 15320 +2
+ Misses 421 420 -1
🚀 New features to boost your workflow:
|

Context
Approximate lookups currently handle values of different types differently depending on the search path.
Breaking change
This change introduces
ApproximateMatchPolicyto make cross-type evaluation explicit.MATCH,VLOOKUP, andHLOOKUPusesameType. Candidates whose type differs from the lookup key are skipped before comparison.XLOOKUPusestotalOrderfor both the linear and binary search paths, so cross-type candidates can be considered when choosing an approximate result.approximateMatchPolicyis now required inSearchOptions. Existing callers that constructSearchOptionsmust provide eithersameTypeortotalOrder.This can change results for approximate lookups over mixed-type data.
How did you test your changes?
Types of changes
Related issues:
Checklist:
Note
Medium Risk
Changes core lookup semantics for mixed-type ranges and may alter existing formula results for approximate
XLOOKUPvs other lookup functions; risk is localized to MATCH/VLOOKUP/HLOOKUP/XLOOKUP evaluation paths.Overview
Approximate lookups now take an explicit
approximateMatchPolicyonSearchOptions, so linear, column-index, and binary search paths apply the same rules when the lookup value and candidates differ in type.MATCH,VLOOKUP, andHLOOKUPpasssameType: approximate lower/upper bounds only consider candidates with the same scalar type as the lookup key (cross-type cells are skipped).XLOOKUPpassestotalOrder, using the existingcompare()ordering across numbers, strings, and booleans to match Excel (e.g. approximateXLOOKUP("a", …)against numeric keys can match).Implementation updates thread the policy through
AdvancedFind.findNormalizedValue,findLastOccurrenceInOrderedRange(via a sharedreturnApproximateResultgate), andColumnIndex.find. Linear approximate search no longer seeds bounds with ±Infinity; it tracks the best index withNOT_FOUNDuntil an eligible candidate appears. CHANGELOG and list-of-differences document the behavior.Reviewed by Cursor Bugbot for commit 964a43e. Bugbot is set up for automated code reviews on this repo. Configure here.