Had pain in the lower left rib and sometimes in the back that comes and goes had blood test and abdominal scan both all clear any ideas what else it b?

Need to examine. It is not feasible to provide a meaningful opinion without taking additional history, and physical examination. It may be due musculo-skeletal issues and may be helped by regular exercise.
For good health - Have a diet rich in fresh vegetables, fruits, whole grains, milk and milk products, nuts, beans, legumes, lentils and small amounts of lean meats. Avoid saturated fats. Drink enough water daily, so that your urine is mostly colorless. Exercise at least 150 minutes/week and increase the intensity of exercise gradually. Do not use tobacco, alcohol, weed or street drugs in any form.
Practice safe sex, if you have sex.