【问题标题】:Search for a value in multiple columns and return all results that are in the right column of the found column在多列中搜索一个值并返回找到的列右列中的所有结果
【发布时间】:2020-04-09 11:59:08
【问题描述】:

在 A 列中搜索值“thisisit”,然后在该行中搜索所有“de”列,然后将其右侧列中的内容返回给我。如果返回多个结果,则在一个单元格中返回结果,但用换行符分隔这些结果。

A1          | B1        | C1          | D1          | E1        | F1        | G1
thisisit    | de        | Bicycle     | en          | Car       | de        | Boot

A3
Bicycle (line break)
Boot

【问题讨论】:

    标签: arrays google-sheets match array-formulas google-sheets-query


    【解决方案1】:

    尝试:

    =TEXTJOIN(CHAR(10), 1, QUERY({TRANSPOSE(FILTER(
     INDIRECT(MATCH("thisisit", A1:A)&":"&MATCH("thisisit", A1:A)), 
     MOD(COLUMN(1:1), 2)=0)), {QUERY(TRANSPOSE(FILTER(
     INDIRECT(MATCH("thisisit", A1:A)&":"&MATCH("thisisit", A1:A)), 
     MOD(COLUMN(1:1)-1, 2)=0)), "offset 1", 0); ""}},
     "select Col2 where Col1 = 'de'", 0))
    

    【讨论】:

    • 好的,我将逗号更改为分号,因为我使用的是 Google 表格,但现在我收到错误消息:“查询只需要 3 个参数,这是数字 4”和“解析公式时出错”
    • 你能分享一份你的工作表吗?
    • 我打开了一个示例表,它现在有其他表名但结构相同:docs.google.com/spreadsheets/d/…
    • 您是否对上述公式进行了修改,它为我提供了整个列(如数组)的所有结果,而不是仅一行?
    猜你喜欢
    • 2022-10-05
    • 2020-01-15
    • 2013-12-24
    • 1970-01-01
    • 2020-07-06
    • 1970-01-01
    • 2021-02-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多