Say I have a number a: How do I calculate the number of ways I can make up number a from the numbers b and c, with of n additions of b and/or c?
For example: a = 4, b = 1, c = 2, n = 3
If I write it out I get the following valid solutions
1 + 1 + 2
1 + 2 + 1
2 + 1 + 1
These are however not valid solutions
1 + 1 + 1 + 1
2 + 2
So the answer for these a, b, c and n should equal 3
Now it's very easy to calculate this manually, but I need a formula for it because I need this outcome in Excel for varying parameters.
If $b=c$ there is either a unique solution, or none.
Now note that even if $b \neq c$, $kb + (n-k)c$ is a different number for each value of $k$, so if for a given $a$ and $n$ there is a solution $k$, it is unique.
Then all you are doing is permuting the summands, so you are counting permutations, which (since you have $k$ and $n-k$ identical elements in the sum) add up to the binomial coefficient $${n \choose k} = \frac{n!}{k!(n-k)!}$$