Here is an example calculation using generating functions. We begin with a matrix

$$ A = \left( \begin{array}{cccc}
1 & -1 & 0 & 2\\
2 & 2 & -3 & 0\\
0 & 2 & 1 & 2 \end{array} \right). $$

Each column contributes a factor of $\sum x^e$ where $e$ ranges over the column:

$$f(x)=(x+x^2+x^0)(x^{-1}+2x^2)(x^0 + x^{-3}+x^1)(2x^2+x^0)$$

Expanding, we see that

$$f(x)=x^{-4} + x^{-3} + 3 x^{-2} + 5 x^{-1} + 6 x^{0} + 10 x^1 + 11 x^2 + 12 x^3 + 10 x^4 +
10 x^5 + 8 x^6 + 4 x^7.$$

These coefficients have a combinatorial interpretation: they count the number of paths of a given sum! For instance, the term $4x^7$ signals that four paths sum to 7.

Unfortunately, we are now in the position of asking for the sum of the coefficients of $f(x)$ in a certain range of degrees. This problem is NP-complete because an efficient algorithm would solve the subset sum problem.

For example: we wish to determine if the set $\{-7, -3, -2, 5, 8 \}$ has a subset which sums to zero (borrowing the example from http://en.wikipedia.org/wiki/Subset_sum_problem). Consider the matrices

$$ B = \left( \begin{array}{ccccc}
0 & 0 & 0 & 0 & 0\\
-7 & -3 & -2 & 5 & 8\end{array} \right) $$

and

$$ B' = \left( \begin{array}{cccccc}
1 & 0 & 0 & 0 & 0 & 0\\
1 & -7 & -3 & -2 & 5 & 8\end{array} \right). $$

Taking $k=0$, $B$ is asking about subsets with negative sum, while $B'$ is asking about subsets with nonpositive sum (each of which will appear twice). Subtracting half the answer for $B'$ from the answer for $B$, we obtain the number of ways to produce $0$ as a subset sum:

$$14-26/2 = 1.$$

This number is not zero, so there exists a subset with sum 0. Worse, this tells us how many such subsets there are, answering a question in #P.