this would be simple enough to do... using the If function with 2 Vlookup functions nested inside (PARTY!!).....but it may get a little confusing trying to write it without know how/where your data is located... are you familiar with how to use the vlookup function?
essentially, my first thought/approach would be to write an IF function where the first condition is using the vlookup to find the value in the 'first column of data', if it can find it (in the "IF TRUE" argument) you'd write the full vlookup funciont so that it returns the value in the same row, 2 columns to the right. If the "IF FALSE" argument, you'd simply write another vlookup to search for the orignal value, but indicate a different 'array table'.... not sure if any of that makes sense
if you could indicate where the data is located that you'd need to reference, it may be easier