Hi and welcome to the forum! I am glad that I can help you.
You want to know the cause of pain located under the lower left rib and in the left shoulder.
Pain under the left rib cage may appear during pancreatitis, or sometimes in cases of heart conditions. Pancreatitis is inflammation of the pancreas and is characterized by pain in the upper abdomen (under the rib cage), which may radiate towards the area between the shoulder blades. In rare cases, pain in the upper left abdomen under the rib cage may indicate infarction of the inferior muscle wall of the heart.
According to the data that you described, you may or may not experience one of the medical conditions listed above. See a gastroenterologist to exclude possible pancreatitis. You may also consider having an ECG scan to exclude possible heart conditions.
Please keep in mind that I provide medical information only. I am not able to diagnose medical conditions. You may consider seeing your doctor for further advice and information about diagnosis and treatment options.