In D17:

=IF(A1=Sheet2!D1,Sheet!D2,"")

Use the same method for other cells changing as required.