Forum Discussion
MATCH vs XMATCH: Binary Search to Find the Last Entry within a Range
Nice work! That will work for text entries. But is there an equivalent for a range comprising numerics, equivalent to
=MATCH(99^99,A:A)
?
- JosWoolleyMar 30, 2023Iron Contributor
Thanks, Sergei. But not very fast, I'm afraid. With A1:A1048575 containing 999 and A1048576 containing 99, 500 copies of your formula take considerably more time to calculate than 500 copies of the formula =MATCH(88^88,A:A). In the latter case, the 500 formulas calculate instantaneously; in your case, several seconds.
This makes sense, since, again, you are not employing binary searching.
Also, 3 functions instead of 1 seems unnecessary overkill.
Regards
- SergeiBaklanMar 31, 2023Diamond Contributor
JosWoolley
Yes, you right, I overestimated TAKE(). On the range without blanks inside I usually use=XMATCH(,A:A)-1
- LorenzoMar 31, 2023Silver Contributor
I had the same idea but no time to check perf. against MATCH this morning
Just did it with 50K rows x 500 columns. From what I can visually observe MATCH still perform better (here)