I would use the functin vlookup, if the "before" table is in A1:C4, I would create the "after" as follows:
A7=A1, A8=A2,...
B7=vlookup(A7,B1:C4,1,false)
C7=vlookup(A7,B1:C4,2,false)
A7=A1, A8=A2,...
B7=vlookup(A7,B1:C4,1,false)
C7=vlookup(A7,B1:C4,2,false)