How to use a string from a single cell as an array in a function without VBA

后端 未结 1 980
无人共我
无人共我 2021-01-28 22:19

How do I convert a string from a cell to a text array inside of a function, that should use the array, without using VBA and without adding the array into any other part of the

相关标签:
1条回答
  • I'm not really sure what you are doing with your formula. But to convert contents of a cell to a comma separated text array to be used as the array argument to the INDEX or MATCH functions, you can use the FILTERXML function. You'll need to educate yourself about XML and XPATH to understand what's going on, but there are plenty of web resource for this.

    For example, with

    A10:  "1.01-1","1.01-3","1.08-1","1.01-1-1A"
    

    The formula below will return 1.08-1. Note the 3 for the row argument to the INDEX function.

    =INDEX(FILTERXML("<t><s>" & SUBSTITUTE(SUBSTITUTE(A10,"""",""), ",", "</s><s>") & "</s></t>", "//s"),3)
    
    0 讨论(0)
提交回复
热议问题