Home » excel » excel – Match value then return value of cell to left or right

excel – Match value then return value of cell to left or right

Posted by: admin May 14, 2020 Leave a comment


I have a range of cells that have different values. I would like to match values of cell but return the values of cell either to the left or right. For simplicity, let’s just say I want the cell 1 column to the left:

enter image description here

Would appreciate any pointers

How to&Answers:

use the following:


enter image description here


Since VLookup only works if your key is the leftmost item in the range and even then only if the range is a flat table from top to bottom, I think you can only do this using VBA. If your data is always exactly that format, you could also simply hardcode one row at the bottom with a specific cell at the top, if it matches the lookup value write the data, then filter the rows to remove errors/empty cells.

In VBA you just specify the starting point of your lookup data, loop through the cells (either down or to the right, then wrap around when you reach emptyness until you’re not finding any more data), compare the cell value to your lookup calue and if it matches, write the data entry at the bottom.