In an expression of the form (one column in, two out):
=ARRAYFORMULA(REGEXREPLACE(A1:A100,...,{"$1","$2"}))
How can I convert just one of the output columns from text to a number (like VALUE
)?
The documentation says:
If a number is desired as the output, try using the VALUE function in conjunction with this function.
However, if I do this:
=ARRAYFORMULA(REGEXREPLACE(A1:A100,...,{VALUE("$1"),"$2"}))
I receive the error ("1" → 1 in this example):
Function REGEXREPLACE parameter 3 expects text values. But '1' is a number and cannot be coerced to a text.
How can I convert just one of the output columns to a number?
I have a complicated expression that produces output like this, and I need to SORT()
on one of the numeric output columns, but I need to convert that column to a number or find some other way to properly sort it, because it sorts incorrectly as text (e.g. "1", "10", "2"), so if that's not possible, how can I SORT
in numerical order on a text column in an array?