设不连续数据单元格如图:
求和公式为:
=IF(B2>0,B2,0)+IF(B4>0,B4,0)+IF(B7>0,B7,0)
如图:
修改数据,效果如图:
假设数据在B1,D2,F4中,求正数和,公式可为
=SUMIF(B1,">0")+SUMIF(D2,">0")+SUMIF(F4,">0")
也可以用
=SUMPRODUCT(CHOOSE({1,2,3},B1,D2,F4)*(CHOOSE({1,2,3},B1,D2,F4)>0))
=IF(A1>0,A1,0)+IF(A3>0,A3,0)+IF(A5>0,A5,0)
=SUMIF(A1:A3,">0",A1:A3)