A few pix would help diagnose.
Bunch of stuff could cause this, but a bent derailleur hanger is a good bet. Is the rear derailleur parallel to the sprockets? Many rear derailleurs take a hit at some point in their life and get bent inward at the bottom. Indexing will never work properly with alignment off.
If it does turn out to be this, don't try bending the derailleur back with your hands. There is a tool for this, the Park DAG-1 (or 2). You remove the derailleur, thread the tool into the derailleur hanger, and align it to 12, 3, 6 and 9 o'clock on the rear wheel.