Need to get multiple correspondent value using lookup function

it looks like that in general it can be solved by grouping the data