Since you have the last values, use

=INDEX($A:$A, MATCH(XXXX,B:B,False))

where XXXX is a cell with the last value for B.

If you need to copy it down instead of to the right, use

=INDEX($A:$A, MATCH(XXXX,INDEX($B:$Z,ROW(A1)),False))