In Excel, the SumIf function adds all numbers in a range of cells, based on a given criteria.
The syntax for the SumIf function is:
SumIf( range, criteria, sum_range )
range is the range of cells that you want to apply the criteria against.
criteria is used to determine which cells to add.
sum_range are the cells to sum.
Examples:
Based on this table:
|
A |
B |
C |
D |
1 |
Volume |
Date |
Value |
|
2 |
10 |
2001 | 100 | 10 |
3 |
21.22 |
2000 | 50 | |
4 |
10 |
2000 | 100 | |
5 |
565.655 |
2005 | 100 | |
6 |
56 |
2003 | 50 |
=SumIf(A2:A6, D2, C2:C6) |
would return 200 |
=SumIf(A:A, D2, C:C) |
would return 200 |
=SumIf(B2:B6, 2003, C2:C6) |
would return 50 |
=SumIf(B2:B6, “>=2001”, C2:C6) |
would return 250 |
Sumif – Excel Function