1

Actually, I have searched about this topic. But I didn't get why it is useful to convert text to a number.

I'm new to SharePoint.Can anyone please help me with that? And give any example based on that topic so that I can understand more effectively.

1 Answer 1

1

If you have a single line of text or choice column in SharePoint list which stores the "numbers" and you want to perform mathematical calculations (Addition, Subtraction, Multiplication, Division, etc.) based on that column, you have to convert the number in text format to actual number value.

If you do not convert it explicitly, SharePoint calculated formula may not work or result into error values.

So, you have to convert the number stored in text columns to actual number value using VALUE() function in SharePoint calculated formulas, for example:

=IF(VALUE([Text column with Number value]) > 10, "Greater than 10", "Less than or equal to 10")

Similar thread: Will a calculated column formula interpret number strings as numbers?

Microsoft documentation: VALUE function

9
  • I didn't get it. The value function is saying that Converts a text string that represents a number to a number. And MSD mentioned Text can be in any of the constant number, date, or time formats. It is not showing the values if a text or choice column has text characters instead of number. Aug 3, 2023 at 10:23
  • If you have a number value (like "123") in single line of text column, VALUE function will convert it to 123 (type: number). If you have "123ABC456", VALUE function cannot convert it to number as it has text characters (which is not valid number as you can see). Aug 3, 2023 at 10:30
  • What is your use case (requirements) for converting text to number? Can you add screenshot of list view with column data which you want to convert to number? Aug 3, 2023 at 10:31
  • Then, What is its use in converting date and time? Aug 3, 2023 at 10:36
  • The VALUE function works with number, date and time formatted inputs. You can check the examples given in documentation. in case of number input, it converts to equivalent number and in case of date & time, it converts to equivalent "serial number" of date & time (similar to excel). You can ignore date part if you only want to convert number stored as text to number data type. Aug 3, 2023 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.