DSUM
Database Functions:
Function: DSUM() - Returns the sum of selected database entries.
Database
+--------+--------+-----+-------+--------+
| A | B | C | D | E |
+----+--------+--------+-----+-------+--------+
| 4 | Tree | Height | Age | Yield | Profit |
| 5 | Apple | 18 | 20 | 14 | 105 |
| 6 | Pear | 12 | 12 | 10 | 96 |
| 7 | Cherry | 13 | 14 | 9 | 105 |
| 8 | Apple | 14 | 15 | 10 | 75 |
| 9 | Pear | 9 | 8 | 8 | 76.8 |
| 10 | Apple | 8 | 9 | 6 | 45 |
+----+--------+--------+-----+-------+--------+
Criteria
+--------+
| A |
+---+--------+
| 1 | Tree |
| 2 | =Apple |
+---+--------+
The total profit from apple trees
=DSUM(A4:E10,"Profit",A1:A2)
DSUM() Result is 225
Criteria
+--------+--------+-----+-------+--------+--------+
| A | B | C | D | E | F |
+---+--------+--------+-----+-------+--------+--------+
| 1 | Tree | Height | Age | Yield | Profit | Height |
| 2 | =Apple | >10 | | | | <16 |
| 3 | =Pear | | | | | |
+---+--------+--------+-----+-------+--------+--------+
Total profit from apple trees with a height between 10 and 16 feet, and all pear trees
=DSUM(A4:E10,"Profit",A1:F3)
DSUM() Result is 247.80000000000001