This is an interesting little discovery regarding the VALUE()
function.
On the formula field reference page, it makes it seem like VALUE()
will simply extract all the numbers from a text string.
But this isn’t true under all circumstances.
The VALUE()
function will sometimes perform mathematical functions as well, if certain symbols are included within the text string!
For example, the formula VALUE("**6hxyzb0**00987**")
will extract all the numbers and return 6000987. This is expected.
But the formula VALUE("**6hxyzb0%%00987**")
will return 60009.87. The very presence of a percentage symbol in the text string makes VALUE()
multiply the extracted numbers by 1%.
Similarly, if the VALUE()
function sees a dash in the text string, VALUE()
interprets the dash as a minus sign and it multiplies the extracted numbers by -1.
So the formula VALUE("123-XYZABC")
will return -123.
Interestingly enough, if it sees 2 dashes, it multiples the 2 negative ones together to get a positive 1.
So the formula VALUE("123-XYZ-ABC")
will return a positive 123.
So it is actually counting up all the dashes in the text string and multiplying each one by negative 1.
There might be other strange mathematical functions happening with the VALUE()
function as well, but those are the 2 math functions that I discovered today.
These sorts of mathematical functions should probably be clarified in the support article.