Simulate string split function in Excel formula

后端 未结 8 1717
难免孤独
难免孤独 2020-12-09 09:15

I am trying to split a string in an excel formula, something like I can do in many programming languages, e.g.

string words = \"some text\".split(\' \');
         


        
8条回答
  •  伪装坚强ぢ
    2020-12-09 09:42

    AFAIK the best you can do to emulate Split() is to use FILTERXML which is available from Excel 2013 onwards (not Excel Online or Mac).

    The syntax more or less always is:

    =FILTERXML(""&SUBSTITUTE(A1,"|","")&"","//s")
    

    This would return an array to be used in other functions and would even hold up if no delimiter is found. If you want to read more about it, maybe you are interested in this post.

提交回复
热议问题