使用Google表中的数组公式搜索多行的多个行的内容,以获取特定文本

发布于 2025-02-04 09:05:41 字数 2537 浏览 4 评论 0原文

我有一个列,每行包含多个单词,以下示例:

Fight; (People: Jack, Gil, Row, Pitt); (Link: Box, Wave, Line, Guard, Circle, Wide, Arrow,)
Fight; (People: Jack, Clive, Gareth); (Link: Box, Wave, Arrow)
Fight; (People: Jack, Gil, Jan); (Link: Box, Wave, Line, Guard, Circle, Wide, Arrow, Square, Attack)

我正在尝试从这些行中汲取特定的单词,以便我可以对其他信息进行分解,例如这些单词出现了多少次或与这些单词相关的时间。问题是我还没有找到一种专门搜索该词和该词的方法。

A列 - 类型B-时间
战; (人:杰克,吉尔,行,皮特); (链接:盒子,波浪,线,后卫,圆形,宽,箭头)0:02:43
战斗; (人:杰克,克莱夫,加雷斯); (链接:框,波,箭头)0:01:54
战斗; (人:杰克,吉尔,扬); (链接:框,波浪,线,后卫,圆形,宽,箭头,广场,攻击)0:00:23

在搜索上述信息中使用以下公式搜索以下公式,我会得到以下结果:

**Participation #** 
=ARRAY_CONSTRAIN(ARRAYFORMULA(FILTER(COUNTIF($A2:$A4, "*" &$D8:$D14 & "*"),NOT(ISBLANK($D8:$D14)))),COUNTA($D8:$D14),1)

**Time** 
=ARRAY_CONSTRAIN(ARRAYFORMULA(IFERROR(SUMIF($A2:$A4,"*" & $D8:$D14 & "*",$B2:$B4),"")),COUNTA($D8:$D14),1)
人们参与#时间
杰克30:05 :00
GIL20:03:06
第30:05:00
PITT10:02:43
CLIVE10:01:54
GARETH10:01:54
JAN10:00:00:23

排名3次,尽管只参加了一次,但由于“箭头”一词。是否可以进行修改,以便我只搜索特定的单词?

I have a column where each row contains multiple words, example below:

Fight; (People: Jack, Gil, Row, Pitt); (Link: Box, Wave, Line, Guard, Circle, Wide, Arrow,)
Fight; (People: Jack, Clive, Gareth); (Link: Box, Wave, Arrow)
Fight; (People: Jack, Gil, Jan); (Link: Box, Wave, Line, Guard, Circle, Wide, Arrow, Square, Attack)

I'm trying to pull specific words from those rows so that I can tally other information, such as how many times those words appear or how much time are associated with those words. The issue is I haven't found a way to specifically search for that word and that word only.

Column A - TypeColumn B - Time
Fight; (People: Jack, Gil, Row, Pitt); (Link: Box, Wave, Line, Guard, Circle, Wide, Arrow)0:02:43
Fight; (People: Jack, Clive, Gareth); (Link: Box, Wave, Arrow)0:01:54
Fight; (People: Jack, Gil, Jan); (Link: Box, Wave, Line, Guard, Circle, Wide, Arrow, Square, Attack)0:00:23

When searching the above information with the following formula, I get these results:

**Participation #** 
=ARRAY_CONSTRAIN(ARRAYFORMULA(FILTER(COUNTIF($A2:$A4, "*" &$D8:$D14 & "*"),NOT(ISBLANK($D8:$D14)))),COUNTA($D8:$D14),1)

**Time** 
=ARRAY_CONSTRAIN(ARRAYFORMULA(IFERROR(SUMIF($A2:$A4,"*" & $D8:$D14 & "*",$B2:$B4),"")),COUNTA($D8:$D14),1)
PeopleParticipation #Time
Jack30:05:00
Gil20:03:06
Row30:05:00
Pitt10:02:43
Clive10:01:54
Gareth10:01:54
Jan10:00:23

Row is being counted 3 times, despite only participating once, because of the word "Arrow". Is there a modification I can make so that I only search for the specific word? Google Sheet for reference and thank you for your time!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦屿孤独相伴 2025-02-11 09:05:41

尝试在E8中尝试:

=ARRAYFORMULA(IFNA(VLOOKUP(D8:D14, QUERY(SPLIT(FLATTEN(SPLIT(A2:A4, ":;, ()", 1)&"×"&B2:B4), "×"), 
 "select Col1,count(Col1),sum(Col2) where Col2 is not null group by Col1"), {2, 3}, 0)))

Try in E8:

=ARRAYFORMULA(IFNA(VLOOKUP(D8:D14, QUERY(SPLIT(FLATTEN(SPLIT(A2:A4, ":;, ()", 1)&"×"&B2:B4), "×"), 
 "select Col1,count(Col1),sum(Col2) where Col2 is not null group by Col1"), {2, 3}, 0)))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文