我有一个像这样的值的关联矩阵:
https://gooddevbaddev.wordpress.com/2013/10/22/ios-7-running-location-based-apps-in-the-background/
Col A
:要计算的值Col B:C
:出现值Cells B1,C1
:SUM
Col A
中的值1
Col B
=SUMIF(B$2:B$5;">=1";$A$2:$A$5)
1*5+2*4+3*1+1*2=18
但是,如果我需要使用出现次数(1)也作为乘数,如何对它进行求和,如下所示:
1*5+5*1=10
和class TapUpdateView(SuccessMessageMixin, UpdateView):
model = Tap
fields = ['number', 'container']
template_name = 'shops/tap_update.html'
success_url = '/shops/tap/'
success_message = "Tap %(number)s was updated successfully"
def get_success_url(self):
return force_text(self.request.GET.get('next', self.success_url))
答案 0 :(得分:3)
如果我理解你的问题:
B1:b
您可能需要将class
更改为=SUMPRODUCT($A$2:$A$5;B2:B5)