【问题标题】:Removing text and only showing a portion of the answer删除文本并仅显示部分答案
【发布时间】:2019-09-02 09:27:09
【问题描述】:

我正在尝试运行返回一些文本的索引匹配,但我不想要全文,只想要在集合中变化的部分。例如,单元格 A1 将包含...

[I want to better understand what you did during this visit] During this visit, did the you... (select appropriate answer) [Receive a tour]

A2...

[I want to better understand what you did during this visit] During this visit, did the you... (select appropriate answer) [Meet with the manager]

你会如何提取它只是说......

A1               A2
Receive a tour   Meet with the manager

文本可以变化很大,有时它会有第二组方括号,有时没有。但谷歌表单数据的一个一致性是最后一对方括号是包含变化答案的部分。我只想得到这个文本。

【问题讨论】:

    标签: regex google-sheets google-sheets-formula array-formulas


    【解决方案1】:

    ...是最后一对方括号是包含不同答案的部分。我只想得到这个文本

    试试这个:

    =ARRAYFORMULA(IFERROR(REGEXEXTRACT(A1:A, "([^\[]*)\]$")))
    

    或者更直白:

    =ARRAYFORMULA(IFERROR(REGEXEXTRACT(A1:A, "\s\[(.*)\]$")))
    

    【讨论】:

      猜你喜欢
      • 2020-04-27
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 2016-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多