Get your taxes done using TurboTax

I think if you look closely you'll see that whenever you have a useable loss, they show the equivalent amount of gain for it to offset.  That amount of gain is then subtracted off your original gain to get your net gain.