Split string in 2 column
I have a field called "Location" in this field we
are storing "City, State". Now we want to show city in other column
and state in other column. Basically I want to split the "Location"
column based on "," (comma).
To achieve this goal I am using the functions:
Let’s see how can we do this with use of above given
functions.
If Errors, I am using ISERROR formula
=IF (ISERROR (currentFormula), "", currentFormula)
I am going to create a calculated column called
"City" and copy & paste the "=IF(ISERROR(LEFT(Location,(SEARCH(",",Location,1)-1))),
"", TRIM(LEFT(Location,(SEARCH(",",Location,1)-1))))"
in the formula text box. This formula will check whether any error is coming or
not if error is coming then it will return blank value otherwise show us
"City Name"
I am going to create a calculated column called
"State" and copy & paste the
"=IF(ISERROR(RIGHT(Location,(LEN(Location)-SEARCH(",",Location,1)))),
"", TRIM(RIGHT(Location,(LEN(Location)-SEARCH(",",Location,1)))))"
in the formula text box. This formula will check whether any error is coming or
not if error is coming then it will return blank value other wise show us
"State Name"
Comments
Ex
Value1,value2,value3,value4,value5,