"I replicated your example to the letter"
If that were true, you would see the same results in E2, E3 and E4 as shown in Badunit's example. there would be no error message in D2 as D2 does not contain a formula, and error messages occur only in cells where there is an error in the writing or the working of that formula.
Examine your version of the example closely and compare it cell by cell to the example. Correct the differences, and you should see the same results as shown in the example.
The syntax for SUMIF is this:
SUMIF(test-values, condition, sum-values)
test-values: the range of cells whose values are to be compared with 'condition.'
In the example, all non-header cells in column A, expressed in the formula as A
condition, include only the values that meet this condition
In the example, "=" (implied) the value in cell D2
sum-values the range of cells whose values are to be included in the sum (if the value in their row of column A
meets the 'condition'.
In the example, values in column B, where the same row of column A contains the same value as D2.
Numbers, in any version, is no more frustrating than any spreadsheet application with respect to this function. Take a closer look, work your way through it, and you'll succeed.