Very nice. Me and another have been working on the formula for a couple a days and yours seems to also have the same problem of not coming out right, typically off by 1-3 flat defense.
So far the ones I have found off are 5's, sunffac, bariss, teebo
If you want to make it easier the Flat Armor value can be calculated
ArmorValue = (600*Armor%)/(100-Armor%)
Example 5's base armor is 37.89%
(600*37.89)/(100-37.89)=366.02
We have also found when calculating the % armor added but % defense mods if you truncate and not round the numbers come out closer
Example 366*.1335=48.86474
Don't round to 49 just truncate to 48