I am looking for a formula or at least something to use when trying to compute how many ways I can make change for an amount.
Example: there are $3$ ways to give change for $4$ if you have coins with denomination $1$ and $2$: $1+1+1+1, 1+1+2, 2+2$.
What formula should I use?
This problem is called integer Partitioning. There is a recursive formula to list all possible partitions of an integer. Given a number of 4 you could generate the following sets of values:
4
3 1
2 2
2 1 1
1 1 1 1
Please refer to Wiki-Partitions for details. Unfortunately, it is not a trivial calculation.
There is another problem related to this that is called Money Changing Problem or Change Making Problem , where you'd be interested in specific values rather than getting all possible values. For example changing Five Dollars in a country where there is no 4 dollar notes or coins.
For such problems you may use R, Mathmatica, etc.