✔ 最佳答案
..................A................B..................................C..............D................E
1................商品...........日期.............................數量..........1月出貨量..2月出貨量
2................X................2009/01/01..................10..............10
3................Y................2009/01/12..................12..............12
4................X................2009/01/12..................20..............20
5................X................2009/01/12..................15..............15
6................T................2009/02/24..................16...............................16
7................X................2009/02/12..................16...............................16
8
9......................................................................Total..........57..............32
你可以先放以下的formula在D2,然後drag去其他計算貨量的cell:
=IF(MONTH($B2)=VALUE(LEFT(D$1,FIND("月",D$1,1)-1)),$C2,"")
將每月的數量分放在column D同column E後,在最底行計column total,eg:
D9=SUM(D2:D7)
E9=SUM(E2:E7)
註:我係用"月"在D1同E1內做key去找出該行是屬於那月份,假定你要做3月在column F,你就要放"3月...",然後drag E2 formula去其他計算貨量的cell.
2014-08-26 02:05:20 補充:
那麼你就放以下formula在D2,然後drag去E2
=SUMPRODUCT($C2:$C99999*(MONTH($B2:$B99999)=VALUE(LEFT(E$1,FIND("月",E$1,1)-1))))