質問するログイン新規登録

回答編集履歴

1

コードがうまく反映されないので修正

2018/10/03 09:38

投稿

mir
mir

スコア3006

answer CHANGED
@@ -2,9 +2,8 @@
2
2
  セル参照で結合する際にスペースが無くなっており、
3
3
  "Orde byCol69desc" といった具合になっていたようです。
4
4
 
5
-
6
- ```=IF(CONCATENATE(B2:E2,B4)="","",QUERY(IMPORTRANGE("売上マスタスプレッドシートのURL","'得意先別売上推移表'!A1:CI1100"),"Select Col6,Col9,Col68,Col67,Col66,Col69,Col70,Col71,Col72,Col73,Col74,Col75,Col76,Col77,Col78,Col79,Col80,Col81,Col85,Col86,Col87 where Col1 is not Null and Col68 like '"& IF(B2="","%","%"&B2&"%") &"' and Col67 like '"& IF(C2="","%","%"&C2&"%") &"' and Col66 like '"& IF(D2="","%","%"&D2&"%") &"' and Col9 like '"& IF(E2="","%","%"&E2&"%") & "' Order by " & VLOOKUP(B4,'マスタ'!C2:E13,2,FALSE) &VLOOKUP(B4,'マスタ'!C2:E13,3,FALSE)&" LIMIT 50",FALSE))
7
- コード
5
+ ```GAS
6
+ =IF(CONCATENATE(B2:E2,B4)="","",QUERY(IMPORTRANGE("売上マスタスプレッドシートのURL","'得意先別売上推移表'!A1:CI1100"),"Select Col6,Col9,Col68,Col67,Col66,Col69,Col70,Col71,Col72,Col73,Col74,Col75,Col76,Col77,Col78,Col79,Col80,Col81,Col85,Col86,Col87 where Col1 is not Null and Col68 like '"& IF(B2="","%","%"&B2&"%") &"' and Col67 like '"& IF(C2="","%","%"&C2&"%") &"' and Col66 like '"& IF(D2="","%","%"&D2&"%") &"' and Col9 like '"& IF(E2="","%","%"&E2&"%") & "' Order by " & VLOOKUP(B4,'マスタ'!C2:E13,2,FALSE) &VLOOKUP(B4,'マスタ'!C2:E13,3,FALSE)&" LIMIT 50",FALSE))
8
7
  ```
9
8
  とし、マスタシート側でVLOOKUPの参照を
10
9