You can figure out this equation by using a standard reduction potential chart and standard potential equation (or Nernst equation).
1. Start off by looking at the reduction of each components of the cell
KCl: K+ ----- K+ + e- ---> K(s)
NaCl: Na+ ---- Na+ + e- -------> Na(s)
2. Now determine the anode and the cathode for the voltage cell. This can be determine by looking at a standard reduction potential chart.
Since Na+ is higher on the chart and has a larger reduction potential, this is the cathode of the voltage. This means that the K+ is the anode of the cell. The potentials change like so:
K+: -2.71 (anode)
Na+: +2.931 (cathode)
K(s) ----> K+ e- (-2.71)
Na+ + e- ----> Na(s) (+2.931)
3. Combined both equations and use the standard potential to determine the voltage of the cell.
E(cell) = E(cathode)-E(anode)
K(s) + Na+ ---> Na(s) + K+ = + 5.641
The voltage increases when NaCl and KCl are added to the voltage cell.