1

Ok, I am having trouble with this equation. I have (4) rows for text entries that have a numeric association depending on what you input. The equation I have does not SUM all four rows. With each text input of "I"=100,"P"=86,"N"=63 with a sum dependant on what was input.

=SUM(IF(A4:D4="I",100)+IF(A4:D4="P",86)+IF(A4:D4="N",63,0))

I should have the number 400 in E4 with "I" entered in A4:D4, or 344 in E4 with "P" entered in A4:D4.

Thank you for any help you can give.

KC

4

2 回答 2

2

您也可以像这样使用“数组”公式来做到这一点

=SUM((A1:D1="I")*100,(A1:D1="P")*86,(A1:D1="N")*63)

您必须使用 Ctrl-Shift 和 Enter 输入它,它将被括在大括号中。

查找“数组公式”以获取详细信息,它们会让您头疼,但会为您节省很多额外的列。

在大型工作表上计算可能需要一段时间。

于 2012-07-27T13:54:58.973 回答
0

您可以在相邻单元格中插入值:(为了格式简单,我将转置数据)

   |  A  |  B  |
1  |  I  | =IF(A1="I";100;IF(A1="P";86;IF(A1="N";63;0)))
2  |  I  | =IF(A1="I";100;IF(A1="P";86;IF(A1="N";63;0)))
3  |  I  | =IF(A1="I";100;IF(A1="P";86;IF(A1="N";63;0)))
4  |  I  | =IF(A1="I";100;IF(A1="P";86;IF(A1="N";63;0)))

然后在E4你有:SUM(A1:A4)

于 2012-07-27T06:40:43.800 回答