You use to Calculate recoil, you have to first find damage so:
Damage = ((((2 * Level / 5 + 2) * AttackStat * AttackPower / DefenseStat) / 50) + 2) * STAB * Weakness/Resistance * RandomNumber / 100
after that, you divide what ever number you get by how much the recoil says. So my damage value comes out to 200, but I get 1/4 damage as recoil, then I take 50 points of damage.