Google Sheets defines several unary functions and operators, and while most of them seem to have a purpose, UPLUS
's help article says
Returns a specified number, unchanged.
From my experimentation, it seems to leave strings and booleans in their original types as well, and I can't figure out what utility this function would have.
See this example spreadsheet for some of the ways in which it seems to have no effect
There are use cases for a function that returns its parameter unchanged, for example when currying.
Strictly speaking, uplus()
doesn't always return references and arrays unchanged. Like many other functions, it only returns the first element, unless evaluated in an array formula context.
One simple use case is to get the first element in an array, like this:
=uplus(filter(A2:A5, len(A2:A5)))
...or, since the uplus()
function corresponds to the unary +
operator, like this:
=+filter(A2:A5, len(A2:A5))
There are nowadays many ways to accomplish the same, such as single()
, but back in the day the unary +
was the easiest way, and it's still used a lot.