简体   繁体   English

如何在 Google 表格中汇总使用 VLOOKUP 和 IMPORTRANGE 获得的结果?

[英]How to sum results obtained with VLOOKUP and IMPORTRANGE in Google Sheets?

I'm currently obtaining the result with the formula below, which was nicely provided by player0, but the challenge now is to obtain not only the figure found, but a sum, since the occurrences in the "database" may be multiple.我目前正在使用以下公式获得结果,该公式由 player0 很好地提供,但现在的挑战是不仅要获得找到的数字,还要获得总和,因为“数据库”中的出现可能是多次的。

=Arrayformula(if(A9:A="";;IFNA(vlookup(A9:A&D9:D&"Expedição"&"Costura";
{IMPORTRANGE("fileId";"Produção!F2:F")&
IMPORTRANGE("fileId-1n3nQ";"Produção!H2:H")&
IMPORTRANGE("fileId-1n3nQ";"Produção!R2:R")&
IMPORTRANGE("fileId-1n3nQ";"Produção!B2:B")\
IMPORTRANGE("fileId-1n3nQ";"Produção!N2:N")};2;0))))

I have tried including sum in many places in the formula above, but with no success.我尝试在上面的公式中的许多地方包含 sum,但没有成功。

Here's a file with dummy data.这是一个带有虚拟数据的文件

Thanks in advance.提前致谢。

use:利用:

=ARRAYFORMULA(IF(A4:A="",,IFNA(VLOOKUP(A4:A&" "&C4:C&" Expedição Costura ",
 QUERY(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY({IMPORTRANGE(
 "1gh5w0czg2JuoA3i5wPu8_eOpC4Q4TXIRhmUrg53nKMU", "Data Origin!A2:R")}, 
 "select Col6,Col8,Col18,Col2,'×',Col14 where Col14>0 label '×'''", )),,9^9)), "×"), 
 "select Col1,sum(Col2) where Col2>0 group by Col1"), 2, 0))))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM