It's not as simple as a vlookup:
There are many ways, but here is one way.
for you data, use =IF(ROWS($A$1:A1)>COUNTIF($B$1:$B$1000,$E$2),"",INDEX($D$1:$D$1000,SMALL(IF($B$1:$B$1000=$E$2,ROW($A$1:$A$1000)-ROW($A$1)+1),ROWS($A$1:A1))))
Notes: you will have define definite ranges....you can't use full column references because this is an array formula.
After you've made changes to the formula, confirm it with Ctrl+Shift+Enter not just ENTER. If done correctly you'll see {} brackets around the formula, then just copy it down the column as far as necessary to get all possible matches. When no more matches are found, blanks are returned.
The formula can be slow if you have a large amount of data to look up so keep column ranges as short as possible.
You may also wish to extract parts of the formula and evaluate them separately (like the Countif) and then refer to that cell in the formula. This reduces repeat calculations.
Alternatively, VBA may be faster (I'm just not savvy enough yet to recommend anything).