Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
If statement 谷歌电子表格查询IF语句_If Statement_Google Sheets_Google Sheets Formula_Google Sheets Query - Fatal编程技术网

If statement 谷歌电子表格查询IF语句

If statement 谷歌电子表格查询IF语句,if-statement,google-sheets,google-sheets-formula,google-sheets-query,If Statement,Google Sheets,Google Sheets Formula,Google Sheets Query,我创建了一个单元格,可以在其中输入公司名称,我的查询过滤结果,只显示来自该特定公司的记录 示例1:这里我键入“TestCompany1”: 示例2:这里我键入“TestCompany2”: 我希望实现的是,当单元格值为空时,它显示所有公司。现在它显示所有的空。如何将查询更改为也允许此操作 如果要使用如果语句,则: =IF(B3<>"", QUERY(Company_overview!A2:L, "where B = '"&B3&"' and L

我创建了一个单元格,可以在其中输入公司名称,我的查询过滤结果,只显示来自该特定公司的记录

示例1:这里我键入“TestCompany1”:


示例2:这里我键入“TestCompany2”:


我希望实现的是,当单元格值为空时,它显示所有公司。现在它显示所有的空。如何将查询更改为也允许此操作


如果要使用
如果
语句,则:

=IF(B3<>"", QUERY(Company_overview!A2:L, 
 "where B = '"&B3&"' 
    and L >= datetime '"&TEXT(TODAY()-B4, "yyyy-MM-dd hh:mm:ss")&"' 
    and L <= datetime '"&TEXT(NOW(),      "yyyy-MM-dd hh:mm:ss")&"'", 1), 
 QUERY(Company_overview!A2:L, 
 "where L >= datetime '"&TEXT(TODAY()-B4, "yyyy-MM-dd hh:mm:ss")&"' 
    and L <= datetime '"&TEXT(NOW(),      "yyyy-MM-dd hh:mm:ss")&"'", 1))
=IF(B3)”,查询(公司概述!A2:L,
其中B='&B3&''
和L>=日期时间“&”文本(今天()-B4,“yyyy-MM-dd hh:MM:ss”)&”
L=日期时间“&”文本(今天()-B4,“yyyy-MM-dd hh:MM:ss”)&”
L=日期时间“&”文本(今天()-B4,“yyyy-MM-dd hh:MM:ss”)&”

如果您想使用
if
语句,那么:

=IF(B3<>"", QUERY(Company_overview!A2:L, 
 "where B = '"&B3&"' 
    and L >= datetime '"&TEXT(TODAY()-B4, "yyyy-MM-dd hh:mm:ss")&"' 
    and L <= datetime '"&TEXT(NOW(),      "yyyy-MM-dd hh:mm:ss")&"'", 1), 
 QUERY(Company_overview!A2:L, 
 "where L >= datetime '"&TEXT(TODAY()-B4, "yyyy-MM-dd hh:mm:ss")&"' 
    and L <= datetime '"&TEXT(NOW(),      "yyyy-MM-dd hh:mm:ss")&"'", 1))
=IF(B3)”,查询(公司概述!A2:L,
其中B='&B3&''
和L>=日期时间“&”文本(今天()-B4,“yyyy-MM-dd hh:MM:ss”)&”
L=日期时间“&”文本(今天()-B4,“yyyy-MM-dd hh:MM:ss”)&”
L=日期时间“&”文本(今天()-B4,“yyyy-MM-dd hh:MM:ss”)&”

L通过共享工作表副本,您可以在15分钟内获得答案(通常需要时间从图像中重新创建整个场景)…通过共享工作表副本,您可以在15分钟内获得答案(通常需要时间从图像中重新创建整个场景)…@RobinViktorsson@RobinViktorsson