NRR(team A) = (total runs scored by team A)/50*number of matches played - (total runs scored against team A)/50*number of matches played.
The only glitch in this equation is if a chasing team reaches target in less than 50 overs. In that case, denominator will be number of overs played and not 50.