vlookup array dependant on selection from data val list.

markswjh

New Member
Joined
Aug 31, 2020
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Hello all
I'm trying to create a Vlookup formula which changes the data array dependant on the the value of a data validation list choice.
like the following

if "2018" is selected it would be =VLOOKUP(B8,'Updated COV Boundaries'!$C$4:$D$54,2,FALSE)
if "2019" is selected it would be =VLOOKUP(B8,'Updated COV Boundaries'!$E$4:$F$54,2,FALSE)
if "2020" is selected it would be =VLOOKUP(B8,'Updated COV Boundaries'!$G$4:$H$54,2,FALSE)

Etc.

Does this make sense? Is it possible?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
N.B. My post shows n/a; I do not have your data.
Edit the range as necessary. A2 on my example is a number; revise the formula if it is Text.

T202010a.xlsm
AB
1
22018#N/A
3b
Cell Formulas
RangeFormula
B2B2=CHOOSE(MATCH(A2,{2018,2019,2020},0),VLOOKUP(B8,'Updated COV Boundaries'!$C$4:$D$54,2,0),VLOOKUP(B8,'Updated COV Boundaries'!$E$4:$F$54,2,0),VLOOKUP(B8,'Updated COV Boundaries'!$G$4:$H$54,2,FALSE))
 
Upvote 0
Thanks Dave! That is perfect! Sorry I would have added spreadsheet but it is full of sensitive data!

Thanks
Will
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,640
Members
448,974
Latest member
DumbFinanceBro

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