dynamic vlookup?

thewiseguy

Well-known Member
Joined
May 23, 2005
Messages
954
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I am trying to understand how to create a vlookup formula that does not need to be changed every time a new column is added to my Table

Here is my output:

20200000-Ener.v1 - Copy.xlsx
BCDE
2Line NoMeasureCodeN/RFloor Number
31PL31
PrescriptiveCalcs
Cell Formulas
RangeFormula
B3B3=Input!B4
C3C3=VLOOKUP(Input!T4,TableProposed,25,0)
E3E3=IF(Input!D4=0,"",Input!D4)



If I add a column to "TableProposed," this Vlookup will no longer work. What can I add to the formula so this is not the case?

Thanks in advance!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try using INDEX and MATCH instead, or XLOOKUP if you only need to use it with 365.
Excel Formula:
=INDEX(TableProposed[xyz],MATCH(Input!T4,TableProposed[abc],0))
Excel Formula:
=XLOOKUP(Input!T4,TableProposed[abc],TableProposed[xyz],"")
In both cases, [abc] refers to column 1 of the table, [xyz] refers to column 25 of the table in your existing formula.
 
Upvote 0
Solution
Try using INDEX and MATCH instead, or XLOOKUP if you only need to use it with 365.
Excel Formula:
=INDEX(TableProposed[xyz],MATCH(Input!T4,TableProposed[abc],0))
Excel Formula:
=XLOOKUP(Input!T4,TableProposed[abc],TableProposed[xyz],"")
In both cases, [abc] refers to column 1 of the table, [xyz] refers to column 25 of the table in your existing formula.

this is great. i was using the 365 array formulas for something else but this totally changes things for me. thanks for the XLOOKUP function, much appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,040
Members
449,063
Latest member
ak94

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top