Please give us some details about your worksheet structure, or just attach the file.
I think Vlookup() or Index(match()) can help you