Archive of Mr Excel Message Board

| Check out our Excel Resources | ||||
![]() |
![]() |
|||
May I suggest a different method: Since your lookup table changes dynamically ("by adding more data" to it), set up a dynamic range for your table.
Assuming that your table currently occupies the range A2:C7:
Step 1. Select this lookup range.
Step 2. Activate Insert,Define,Name. Type for Names in worbook:
DYNTABLE (or whatever name that is meaningful to you)
and enter the following formula for Refers to:
=OFFSET(Sheet2!$A$2,0,0,COUNTA(Sheet2!$A:$C),3)
And click OK.
After all this you can use the name DYNTABLE in your VLOOKUP-formulas, and add more data to your table whenever needed.
Note that columns A to C should not contain any data other than your table.
Aladin
