I have pain in my left side of stomach near rib cage and blood in stool. Pain is not constant. Been happening for about two years. Somedays no pain?

Worrisome. You don't mention age or any other symptoms, but the fact of the matter is that this is not normal and should not have gone on this long without an evaluation with ct scan and or colonoscopy. See a specialist and hopefully you have not waited too long to do so.