DCOUNTA
Database Functions:
Function: DCOUNTA() - Counts the cells in a set of database records that match criteria.
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 | N/A | 10 | 75 |
| 9 | Pear | 9 | 8 | 8 | 77 |
| 10 | Apple | 12 | 11 | 6 | 45 |
+----+--------+--------+-----+-------+--------+
Criteria
+--------+--------+-----+-------+--------+--------+
| A | B | C | D | E | F |
+---+--------+--------+-----+-------+--------+--------+
| 1 | Tree | Height | Age | Yield | Profit | Height |
| 2 | =Apple | >10 | | | | <16 |
+---+--------+--------+-----+-------+--------+--------+
The Number of Apple trees between 10' and 16' in height
=DCOUNTA(A4:E10,"Age",A1:F2)
DCOUNTA() Result is 2
Criteria
+--------+
| A |
+---+--------+
| 1 | Tree |
| 2 | =Apple |
| 3 | =Pear |
+---+--------+
The Number of Apple and Pear trees in the orchard
=DCOUNTA(A4:E10,3,A1:A3)
DCOUNTA() Result is 5