简体   繁体   中英

Excel Formula - SUMIF?

I am trying to add values from column C (Number) based on criteria from columns A (Name) and B (Date).

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. 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). Now what I need to do is add another criteria to check if the dates (column 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(C:C,A:A, "Allen", B:B, "5/6/2014")

Look at SUMIFS function, that allows you to use multiple criteria, eg

=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

Note that with SUMIFS the range to sum is shown first

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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