具有4种条件的导入范围

时间:2019-05-06 14:30:46

标签: if-statement google-sheets-formula importrange

我创建了一个带有2个下拉列表选项的仪表板(区域和业务线)。每个下拉菜单都有“全部”选项,可以选择所有选项。

菜单1-区域:亚洲,DACH,北美,所有 菜单2-业务范围:CROF,CROC,通讯,全部 菜单3-日期过滤器

-条件1:当菜单1为“全部”时,则从所有区域和菜单2选项之一导入范围 -条件2:当菜单2为“全部”时,则从所有业务行和菜单1选项之一导入范围 -条件3:当菜单1和2为“全部”时,则仅基于日期过滤器导入范围 -条件4:将菜单1和2选择为单独选项时

我尝试使用此代码,但不起作用。它只显示第一行数据

=IFS(B3="'All'", QUERY(IMPORTRANGE("14dZCHHnIWNgnE7aufM6Uv7XZkYjViKiVN2J2NLAsIjg", "'Main Calendar'!A:A1000"),"Select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12, Col19, Col32 where Col2>=date'"&TEXT(B5,"yyyy-mm-dd")&"' AND Col3<=date'"&TEXT(B6,"yyyy-mm-dd")&"' AND Col10='"&B4&"'"), 
B4="'All'", QUERY(IMPORTRANGE("14dZCHHnIWNgnE7aufM6Uv7XZkYjViKiVN2J2NLAsIjg", "'Main Calendar'!A:AG"),"Select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12, Col19, Col32 where Col2>=date'"&TEXT(B5,"yyyy-mm-dd")&"' AND Col3<=date'"&TEXT(B6,"yyyy-mm-dd")&"' AND Col32='"&B3&"'"), 
AND(B3="All",B4="All"),QUERY(IMPORTRANGE("14dZCHHnIWNgnE7aufM6Uv7XZkYjViKiVN2J2NLAsIjg", "'Main Calendar'!A:AG"),"Select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12, Col19, Col32 where Col2>=date'"&TEXT(B5,"yyyy-mm-dd")&"' AND Col3<=date'"&TEXT(B6,"yyyy-mm-dd")&"'"), 
TRUE, 
QUERY(IMPORTRANGE("14dZCHHnIWNgnE7aufM6Uv7XZkYjViKiVN2J2NLAsIjg", "'Main Calendar'!A:AG"),"Select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Col9, Col10, Col11, Col12, Col19, Col32 where Col2>=date'"&TEXT(B5,"yyyy-mm-dd")&"' AND Col3<=date'"&TEXT(B6,"yyyy-mm-dd")&"' AND Col32='"&B3&"' AND Col10='"&B4&"'"))

这是我期望的仪表板 http://tinypic.com/r/2lj4b3p/9

您的帮助非常宝贵,非常感谢

0 个答案:

没有答案