首页 > 解决方案 > 谷歌表格查询想要要求用户输入一个包含字段

问题描述

他们想要搜索的一些数据包含一个',我的代码如下所示

=query(Sheet1!A:A,"select * where upper(A) contains '"&upper(A1)&"'")

他们可能在 A1 中键​​入的一些示例搜索是

Test' Bob
1274'2134
asd''asd
test2

标签: google-sheetssubstitutiongoogle-sheets-formulaarray-formulasgoogle-sheets-query

解决方案


=ARRAYFORMULA(SUBSTITUTE(QUERY(SUBSTITUTE(A:B, "'", "♦"), 
 "where upper(Col1) contains '"&SUBSTITUTE(UPPER(D1), "'", "♦")&"'", 0), "♦", "'"))

0


推荐阅读