You need to sign in to do that
Don't have an account?

Salesforce Formula to determine the number of spaces in a text field.
I am trying to create a formula in Salesforce to count the number of spaces in a text string and determine if the count of total spaces is less than one.
Not sure if that is even possible, please let me know if you need more context.
To calculate the number of spaces in the text field, use this formula:
Len(Field Name)- Len(SUBSTITUTE(Field Name, ' ', ''))
The above formula will give you the total number of spaces in a text string and to determine the count of total spaces is less than one use :
Len(Field Name)- Len(SUBSTITUTE(Field Name, ' ', '')) < 1
Let me know if above formula solves your problem.
Many Thanks,
Sunil Rathore
All Answers
To calculate the number of spaces in the text field, use this formula:
Len(Field Name)- Len(SUBSTITUTE(Field Name, ' ', ''))
The above formula will give you the total number of spaces in a text string and to determine the count of total spaces is less than one use :
Len(Field Name)- Len(SUBSTITUTE(Field Name, ' ', '')) < 1
Let me know if above formula solves your problem.
Many Thanks,
Sunil Rathore
This works, thanks Sunil!