google-sheets - How to use several conditions with QUERY + IMPORTRANGE in google sheets?
问题描述
I'm trying to get unique values by using this formula:
=UNIQUE(QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/here goes link","Income!2:8000"),"Select Col15,Col16, Col26 where Col3=" & "'" & B2 & "'"))
And I'm getting the result that I need. The only problem is that I'd like to add an additional condition to it and have no idea how to do it.
I'd like this formula to filter values not only based on Col3 but based on another one, for example, Col3 = B2
and Col2 = A2
.
Does anyone have any idea how to do it?
Thank you in advance!
解决方案
更新:根据您共享的工作表和数据格式,此公式应该有效:
=UNIQUE(QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1pXFIWzeHcJPQJtjUqOdgi2FusNGEUoeGlA5rLGNuKLQ/edit#gid=0","data!2:500"),"Select Col15, Col16, Col26 where Col3 = '"&B2&"' and Col2 = date'"&TEXT(DATEVALUE(A2), "yyyy-mm-dd")&"'")
您可以使用and
withwhere
来检查多个条件。
=UNIQUE(QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/here goes link","Income!2:8000"),"Select Col15, Col16, Col26 where Col3 = '"&B2&"' and Col2 = '"&A2&"'"))
推荐阅读
- php - 如何在单个输入中发布多个数组
- python - 最近邻计算中的条件检查错误?
- python - AWS Lambda 无法从层导入模块
- python - 如何清除与所有行合并的pandas中名为“Unnamed”的行?
- c++ - 获取“错误:']'标记之前的预期主表达式”c ++
- javascript - 如何使用Javascript从对象数组中的数组道具中获取不明确的值
- c# - 使用 ILogger 和抽象类 .NET Core 进行依赖注入
- javascript - 有谁知道为什么 Redux 的设计者使用函数而不是类来编写 Redux 存储?
- flutter - 如果安装 apk 则未安装然后显示空白屏幕。颤振飞镖语言
- json - 为 SQL Server JSON 结果项中的每个项目设置一个“根”?