Match and extract values on different columns