Possible ways to have $n$ bounded natural numbers with a fixed sum Is it possible to count in an easy way the solutions of the equations and inequalities $x_1+x_2+\cdots+x_n = S$ and $x_i\leq c_i$ if all $x_i$ and $c_i$ are natural numbers?

Assume that $\sum_{i=1}^n c_i \ge S$.  The Question asks about "natural numbers", so there is a bit of ambiguity about whether $x_i = 0$ is allowed.  We will assume it is, but if not, then the problem may be transformed by asking for nonnegative integers $y_i = x_i - 1 \le c_i - 1$ to sum to $S-n$.  Then $y_i \ge 0$ guarantees $x_i \ge 1$.
It may help to put the Question ("Is it possible to count in an easy way..."?) and the helpful expressions given by JMoravitz in context to note that this is equivalent to counting the $2$-row contingency tables where the top row (of nonnegative integers $x_i$) sums to $S$ and the bottom row to $\left(\sum_{i=1}^n c_i \right) - S$, and the $i$th column adds to $c_i$.
Dyer, Kannan, and Mount (1995), Sampling Contingency Tables, showed that such counting problems are $\#P$-complete.  So, barring some unforeseen breakthrough in the theory of algorithms, these can be exponentially hard computations.
The earliest appearance of "formulas" equivalent to counting these I know of are in the papers of Percy MacMahon assembled as Combinatory Analysis in 1915.
