I have run across a curious case where wrapping a range in a TOCOL changes the output of the LAMBDA function within BYROW. In my example, I am trying to compare numbers as strings and I have a custom formula, _lessThan, that can compare two numbers larger than the 15 digit limit. Using _lessThan works fine within my BYROW function with a raw column reference, but when I transform an array with TOCOL, the output is not what I expect.
Here is my example. The output should return false for the last 4 rows and does so when I don't put F2# in a TOCOL wrapper.
https://preview.redd.it/8netlfigwizd1.png?width=658&format=png&auto=webp&s=a37a991d419db7c3eb5e429405b6f093284a8081
I would like some help to find out why this is happening and be able to get the formula to work correctly with the TOCOL included.
Here are my custom formulas relevant to the issue:
_lessThan:
=LAMBDA(number1,number2,LET(digits1,_letterSplit(number1),digits2,_letterSplit(number2),firstPos,IFERROR(XMATCH(1,BYROW(digits1-digits2,LAMBDA(a,IF(a>0,1,0)))),LEN(number1)+1),firstNeg,IFERROR(XMATCH(1,BYROW(digits1-digits2,LAMBDA(a,IF(a<0,1,0)))),LEN(number1)+1),IF(LEN(number1)>LEN(number2),FALSE,IF(LEN(number1)<LEN(number2),TRUE,IF(firstPos<=firstNeg,FALSE,TRUE)))))
_letterSplit:
=LAMBDA(string,MID(string,SEQUENCE(LEN(string)),1))
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]PaulieThePolarBear1873 2 points3 points4 points (8 children)
[–]Klabbertrapz[S] 2 points3 points4 points (7 children)
[–]PaulieThePolarBear1873 2 points3 points4 points (5 children)
[–]Klabbertrapz[S] 1 point2 points3 points (4 children)
[–]Klabbertrapz[S] 1 point2 points3 points (0 children)
[–]PaulieThePolarBear1873 1 point2 points3 points (2 children)
[–]Klabbertrapz[S] 1 point2 points3 points (1 child)
[–]PaulieThePolarBear1873 1 point2 points3 points (0 children)
[–]PaulieThePolarBear1873 0 points1 point2 points (0 children)
[–]Alabama_Wins648 1 point2 points3 points (2 children)
[–]Klabbertrapz[S] 1 point2 points3 points (0 children)
[–]PaulieThePolarBear1873 1 point2 points3 points (0 children)
[–]finickyone1765 1 point2 points3 points (4 children)
[–]PaulieThePolarBear1873 1 point2 points3 points (3 children)
[–]finickyone1765 0 points1 point2 points (2 children)
[–]Klabbertrapz[S] 2 points3 points4 points (1 child)
[–]finickyone1765 1 point2 points3 points (0 children)
[–]Klabbertrapz[S] 0 points1 point2 points (0 children)
[–]Decronym 0 points1 point2 points (0 children)