Problem:

Columns A:B contain the number of points scored by a certain player during each quarter.
An empty cell indicates no points were scored during that quarter.
When using this array formula to total the points scored during the 2nd half, it returns #VALUE!.


Solution:

It is most likely that the blank cell in column A is actually not empty, but contains an invisible space.
Use the ISNUMBER and IF functions, combined in the following Array Formula to disregard such cells, and thus avoiding errors:
{=SUM(IF(ISNUMBER(A2:A5),(A2:A5)*((B2:B5=3)+(B2:B5=4))))}

(To create Array formula: select the cell after typing the formula,press F2 and then press Ctrl+Shift+Enter)

Example:

Points___Quarter
8________1
5________2
_________3
2________4