|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 mjm04 于 2024-9-4 15:38 编辑
WPS /M365 可以用
考虑到D列 有可能存在多套的情况,最后部分加了相乘
=IFERROR(REDUCE({"订单编号","商品编码","商品编码数量","商品明细","商品明细数量"},B2:B10,LAMBDA(a,b,VSTACK(a,HSTACK(FILTER(B2:B10,B2:B10=b),FILTER(C2:C10,B2:B10=b),FILTER(D2:D10,B2:B10=b),FILTER(K2:K20,J2:J20=FILTER(C2:C10,B2:B10=b)),FILTER(L2:L20,J2:J20=FILTER(C2:C10,B2:B10=b))*FILTER(D2:D10,B2:B10=b))))),"")
=======================================================================================
受 4楼 启发,还可以写成以下的,效果不变,短一些
=IFNA(REDUCE({"订单编号","商品编码","商品编码数量","商品明细","商品明细数量"},B2:B10,LAMBDA(a,b,VSTACK(a,HSTACK(OFFSET(b,,,,3),FILTER(K2:K20,J2:J20=OFFSET(b,,1)),FILTER(L2:L20,J2:J20=OFFSET(b,,1))*OFFSET(b,,2))))),"")
|
|