Here is how it is. When it says attack, it is inttelegence and attack catagorized in the same field. Sorry for the confusion, everyone else seems to be going attack power based that inferring intellegence was just something I worried about.
And the edit of the formula? It is possible cuz the site is going through a lot of heavy upgrads soon. Thank you for the question and i hoped this helped.