我希望能够找到包含特定字符串的单元格

问题描述 投票:0回答:1

是否有一个函数能够搜索 Google 工作表中的所有单元格并返回包含特定字符串的单元格?例如:每个单元格中有 1 个随机单词,我想找到包含单词 Hello 的单元格。

我该怎么办?谢谢!

google-sheets google-sheets-formula
1个回答
0
投票

如果您使用 Apps 脚本,则可以使用 TextFinder 类: https://developers.google.com/apps-script/reference/spreadsheet/text-finder

例如:

//Find cells that contain "C"
let ranges = SpreadsheetApp.getActive()
 .createTextFinder("C")
 .matchEntireCell(true)
 .matchCase(true)
 .matchFormulaText(false)
 .ignoreDiacritics(true)
 .findAll();

来源:https://spreadsheet.dev/find-and-replace-google-sheets-textfinder-apps-script

如果您需要直接在表格中输入公式,可以尝试 VLOOKUP https://support.google.com/docs/answer/3093318?hl=en

© www.soinside.com 2019 - 2024. All rights reserved.