=QUERY('BD3'!A:Q,
"SELECT L,D,I,SUM(M)
WHERE I='W34' AND M>0 AND L='Huacho'
GROUP BY L,D,I",-1)
我只需要显示m列的前5个和
=query('BD3'!A:Q, "SELECT L,D,I, SUM(M) WHERE I='W34' AND M>0 and L='Huacho' GROUP BY L,D,I ORDER BY SUM(M) DESC LIMIT 5",-1)