hugodiz / TextUtilsDNA

High-performance text wrangling and fuzzy lookup functions for Excel, powered by .NET via ExcelDNA
MIT License
7 stars 1 forks source link

Blunder in LSDLOOKUP K pre-validation (FnK) #1

Closed hugodiz closed 3 years ago

hugodiz commented 3 years ago

Based on LSDLOOKUP user input K, the value of FnK has a guard in order to be between 1 and 1024, inclusive.

Additionally, it is meant to be limited to not be higher than the number of elements in lookup_array B (otherwise we're just adding spurious #N/A columns to the right of the output). Although the code right now applies that limit, it erroneously does so within other if-else branches, such that there are pathways being missed. It should simply be doing the basic guard first (1-1024) and applying the limit afterwards.

hugodiz commented 3 years ago

Fixed with commit 27f1164dc12832322601e31f28d1af6d138cb576 to main