Forum Discussion

Boblebad's avatar
Boblebad
Copper Contributor
Jan 26, 2022
Solved

Very odd VLOOKUP problem

Hello   I have a very odd problem with the VLOOKUP.   I have a workbook where i have some data for importing to my Wordpress website. I needed to add a column for taxonomy, so i added author name...
  • HansVogelaar's avatar
    HansVogelaar
    Jan 27, 2022

    Boblebad 

    In your original formula in L2 =VLOOKUP(K2;P2:Q712;2;FALSE), the references to K2 and to P2:Q712 are relative. this means that Excel will adjust them automatically when you fill or copy L2 to other cells.

    In L3 it becomes =VLOOKUP(K3;P3:Q713;2;FALSE), in L4 it will be =VLOOKUP(K4;P4:Q714;2;FALSE) etc.

    The change from K2 to K3, K4, ... is exactly what you want, but the change from P2:Q712 to P3:Q713 etc. is not. It causes the first IDs to drop out of the range.

    To prevent this, we add $ signs. They make the reference absolute. Excel will not change an absolute reference when you fill or copy the cell with the formula to other cells.

    So the formula in L2 =VLOOKUP(K2;$P$2:$Q$712;2;FALSE) will become =VLOOKUP(K3;$P$2:$Q$712;2;FALSE) in L3, and =VLOOKUP(K4;$P$2:$Q$712;2;FALSE) in L4, etc.

    The reference to K2 changes, as desired, but the reference to $P$2:$Q$712 does not change.

    The easiest way to change P2:Q712 to $P$2:$Q$712 is to select it in the formula and to press F4.

     

    For more info, see Switch between relative, absolute, and mixed references 

Resources