How to.png

So I have a long list of numbers and letters that sometimes account for a different amount of values i.e. ?h?h could have a value of 1 or 6. So i would like to find a way that will allow me to assign different values to the data i have and then add them all together. I am not sure how to do this. So i could have an extra column that perhaps has an If ?h?h = a certain cell or IF ?s?s = certain cell. But i was wondering if there was an easier way to do this as that would be a lot of IFs. The pic probably explains better. Hope you can help.

Thanks,

Excel noob