简体   繁体   English

Excel公式-SUMIF?

[英]Excel Formula - SUMIF?

I am trying to add values from column C (Number) based on criteria from columns A (Name) and B (Date). 我试图根据A列(名称)和B列(日期)的标准添加C列(数字)中的值。

Name(A)   Date(B)   Number(C)  Total by Name by Date (D)
Allen     5-6-14    12.75
Allen     5-6-14    2.88
Allen     5-12-14   1200.75
Doug      3-2-14    1111.11
Doug      3-2-14    2222.22
Doug      5-6-14    99.99
Greg      8-1-14    555.55
Steve     8-1-14    11.99
Zoe       8-1-14    77.33
Zoe       8-1-14    33.78

In column DI am looking to add up the number based on the name and date. 在DI列中,希望根据名称和日期将数字相加。 For example, 例如,

Allen    5-6-14    15.63
Allen    5-12-14   1200.75
Doug     3-2-14    3333.33
Doug     5-6-14    99.99
Greg     8-1-14    555.55
Steve    8-1-14    11.99
Zoe      8-1-14    111.11

I started off with this: 我从这个开始:

=SUMIF(A:A, "Allen", C:C)

which will give me the value of 1216.38 (all of the dates added up for Allen). 这将使我的值为1216.38(Allen的所有日期加起来)。 Now what I need to do is add another criteria to check if the dates (column B). 现在,我需要添加另一个条件来检查日期(B列)。 I know this can be done using a pivot table, found here ( Formula for monthly sum by person ) but I am curious on if there is another way to do this. 我知道可以使用数据透视表来完成此操作,该数据透视表位于此处( 按人计算的月度总和 ),但我很好奇是否还有另一种方法可以做到这一点。

Any help on this would be much appreciated. 任何帮助,将不胜感激。

Wow just figured it out. 哇,想通了。 Sorry to waste anyone's time. 很抱歉浪费任何人的时间。

Using SUMIFS... 使用SUMIFS ...

=SUMIFS(C:C,A:A, "Allen", B:B, "5/6/2014")

Look at SUMIFS function, that allows you to use multiple criteria, eg 查看SUMIFS函数,它允许您使用多个条件,例如

=SUMIFS(C:C,A:A,"Allen",B:B,DATE(2014,5,6))

or you can use cell refs as criteria and copy formula down, eg 或者您可以使用单元格引用作为条件并向下复制公式,例如

=SUMIFS(C:C,A:A,J2,B:B,K2)

where J2 is a specific name and K2 a specific date 其中J2是特定名称,K2是特定日期

Note that with SUMIFS the range to sum is shown first 请注意,对于SUMIFS,求和范围首先显示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM