Capacitor B needs to be the smallest targeted value as it will always be in the circuit. Since it will always be there, it will add to each of the other values that you switch in - so you need to reduce those outer caps by the value of the middle cap.
For example, let's suppose you want to switch 2.2nF, 3.3nf, and 4.7nF.
2.2nf needs to be in B position.
Position A needs 1.1nF (3.3nf targeted value minus 2.2nF in position B). When cap A is switched in, cap A and cap B will be in parallel - adding the 2 values - yielding 3.3nF. (1.1nF + 2.2nF)
Position C needs 2.5nF (4.7nf targeted value minus 2.2nF in position B) yielding 4.7nF when switched in. (2.2nF + 2.5nF)
Hope that made sense.