In Column G, I placed the following =MID(A2,4,4)*1 as a helper column
Then in Column D, I placed the following =INDEX($B$2:$B$5,MATCH(D2,$G$2:$G$5,0))

and copy down each.