I don't have T-Mobile, but I find that a lot of times, the local unit of your carrier can be more helpful than corporate. Just being able to sit down and talk to someone is a big pro that I find with transporting yourself to them, rather than calling in.
However, that isn't what you asked for.
So,
assuming your monthly payment for the phone is $20/mo. then your cancellation fee would be: $20 * 22 mos. = $440 dollars.
If you aren't paying $20/mo. for your phone payment, then your cancellation fee will be different. Multiply your monthly payment by the remaining months for the cancellation fee.
Again,
assuming you have a 24 mo. payment plan for your phone, then you've had it for two or so months and T-Mobile won't cover the phone. However, all Samsung handsets and Batteries are covered by a 1-year manufacturer's warranty. (Cases/Pouches/Holsters are covered for 90 days, and other phone accessories are covered for a year.) The follow conditions apply to battery coverage from the 1-year warranty provided by SAMSUNG:
"This Limited Warranty covers batteries only if battery capacity falls below 80% of rated capacity or the battery leaks, and this Limited Warranty does not cover any battery if (i) the battery has been charged by a battery charger not specified or approved by SAMSUNG for charging the battery; (ii) any of the seals on the battery are broken or show evidence of tampering; or (iii) the battery has been used in equipment other than the SAMSUNG phone for which it is specified."
You can read more on Samsung's warranty
here.
If the above doesn't make your battery ineligible repair/replacement, then your S3 will be in working condition after return. If you do wish to return your device, you can return through T-Mobile to immediately receive a replacement device. Just remember this, and read up on the rest of the T-Mobile return policy:
"To receive a replacement phone in advance from T-Mobile, you must agree that we may charge you an out of warranty fee for the value of the equipment if your phone is found to be outside the manufacturer warranty period and/or is physically damaged in a manner not covered by the manufacturer