是否有一个函数能够搜索 Google 工作表中的所有单元格并返回包含特定字符串的单元格?例如:每个单元格中有 1 个随机单词,我想找到包含单词 Hello 的单元格。
我该怎么办?谢谢!
如果您使用 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