The Excel 2019 functions min(), max(), MinA(), and MaxA() don't work on non-numeric arguments. A StackOverflow answer gave a formula for performing the max and min operations on text values:
{=index(A2:A6, match(0, CountIf(A2:A6, ">" & A2:A6), 0))}
for max, with min being the same with ">" changed to "<", and where {...} means an array formula entered with Ctrl-Shft-Enter.
This works well, but I've found a strange behavior in it. If the given range includes blank cells (i.e., empty, i.e., containing nothing) at the end of the range or inside the range, it works fine, but if it includes blanks at the beginning of the range, the formula returns 0:
To complicate matters further, if the blank cells are replaced with empty strings, ="", then the above behavior is the same, except that the one with the empty string at the beginning becomes empty instead of 0.
What is going on here? Why does this formula work with blanks or empty strings at the end or inside the range, but not at the beginning?
