问题
I have the table in Excel:
In column C
(Sum) I want to get sum this way:
- If in column
A
orB
value is 1 then takeAmount
48 and multiply byMultiplier (1)
= 2. - If in column
A
orB
value is 0 then takeAmount
48 and multiply byMultiplier (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