I don't think this can be done as pure formulas, but this VBA macro will do it
VLOOKUP.xlsm