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.
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.