Forum Discussion
Can I split information in a field?
- May 03, 2024
You could also employ =CHOOSECOLS(TEXTSPLIT(A1,"/"),1,4) if you have a new version of Excel or subscription to Microsoft 365. This formula has the advantage of working even if the strings of digits vary in length. (If the number of slash marks change, you will need to adjust up or down the final digit to reflect that.)
The formula
= TEXTSPLIT(string, {"/"," "}, , TRUE)
will remove the empty fields by using the space character itself as a separator. This would give several more blank cells except for the final parameter that causes them to be removed.
If the single string were to become a list of strings you would hit the dreaded 'array of arrays' error in which Excel classes the correct solution to the problem as unsupported. If you could guarantee that all the substrings were 5 characters long then
= LET(
concat, MAP(list, LAMBDA(term, CONCAT(TEXTSPLIT(term, {"/"," "}, , TRUE)))),
MID(concat, {1,6,11}, 5)
)
should work.