How to get weighted sum depending on multipliers in column in Excel?

爱⌒轻易说出口 提交于 2019-12-13 07:06:02

问题


I have the table in Excel:

In column C (Sum) I want to get sum this way:

  • If in column A or B value is 1 then take Amount 48 and multiply by Multiplier (1) = 2.
  • If in column A or B value is 0 then take Amount 48 and multiply by Multiplier (0) = 1,5.
  • Then K1 and K2 summed.

So for row 2 the result in column C will be: 48*2 + 48*2 = 192.
For row 5 the result in column C will be: 48*1,5 + 48*2 = 168.


Is it possible to automate this process using Excel formula for C column (inspite of number of columns)?


回答1:


Or you could use Countif (no shorter though)

=COUNTIF(A2:D2,0)*I$2*I$1+COUNTIF(A2:D2,1)*I$3*I$1




回答2:


Use Ctrl+Alt+Enter when entering (since it's an array formula)

EDIT: I'm not great with formulas, so there is I'm sure a shorter alernative...



来源:https://stackoverflow.com/questions/40012741/how-to-get-weighted-sum-depending-on-multipliers-in-column-in-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!