Board Thread:General Discussion/@comment-25000380-20140626153209/@comment-24088226-20140626185405

You add all the passive (friendship, auto-skill, elemental buildings, unit bonuses) bonuses together and apply it to the cards attack/defense (the number in white that's capped at 19,999 or 29,999). This creates the number you see in blue on cards. For example a max attack HSR has 19,999 attack. With +40% from 2 max elemental buildings, +5% from friendship, and +15% from the SR Force unit bonus you get 19,999 + 11,999 shown on the card.

Activatable abilities such as Himiko's +200% buff takes the total attack and multiplies it. However the actual damage you deal also takes into account an ~8% random factor up or down, the card's current percentage of soldiers compared to it's max soldiers, and the enemies defense. As far as I know, no one has found the exact formula nubee uses though there was a fairly accurate estimate posted somewhere awhile back.