Residual alkalinity is defined by
RA = alkalinity - (Ca_hardness + Mg_hardness/2)/3.5
Thus the only ions you need to consider in calculating it are
Calcium
Magnesium
Bicarbonate
and
Carbonate.
Hydroxyl ions also contribute to alkalinity for waters of higher pH.
Strictly speaking you need to consider all charged ions in the soup (fluoride, chloride, iron, nitrate, sulfate....) because these effect the activity coefficients of calcium, magnesium, bicarb and carb but the effects are, for brewing water, small enough that these can be ignored. The error introduced is less than that which is associated with not really knowing what the definition of alkalinity is. The lab is required (per Standard Methods) to tell you what pH was used for the end point of the alkalinity titration but I've never seen a report that actually does that.
The problem with the spreadsheets seems to be that they try to extend the concept of RA to mash as well as water. RA was not intended for this but if you can calculate the RA of water with lactic acid added why not for water with the acids contained in malt? The answer lies in the fact that the concept of RA relies on the idea that malt phosphates will react with calcium and mangnesium to release protons and thus acidify the malt (this is where the 1/2 and 1/3.5 factors come into it). The other big problem with the spreadsheets is that they do not calculate alkalinity correctly where bicarbonate or carbonate are involved (or additions of other weak acids such as phosphoric, lactic, citric etc). One can get away with this to a certain extent as long as pH is below 8.3 or so.
One must remember with respect to RA that its value is pretty much limited to comparison of water supplies. The 1/2 and 1/3.5 factors are nominal. Computer simulations of the chemistry of phosphate/carbonate systems shows that these numbers are only realized when certain assumptions are made about the amount of inorganic phosphate released by malt. The same goes for the tie in between RA and
knockout wort pH, no not mash pH, knockout wort pH (see Kolbach's original paper at
www.wetnewf.org). Again, typical values can be computed but they are for base malt only mashes and, as the brews studied were German, presumably the base malts were Pilsner malts.