Running a VLKKUP against an increasing / decreasing set of rows

fuzzyjonclay

New Member
Joined
Jul 30, 2017
Messages
9
Hi there

I wonder if you could please help me with my query regarding adding a VLOOKUP to rows of data that increase and decrease in number? The scenario is this - I have a bunch of data rows that pull down from a SQL Server view. On day 1 the total number of rows might be 30, then on day 2 it might be 50 then on day 3 it might be 35 etc. I need to put a VLOOKUP in column 2 on each row. That's all pretty straightforward!

What I want to know is if it's possible to expand / reduce the cells containing the VLOOKUP depending on how many rows of data there are? So, what I'd like is something like this (i.e. I have 3 rows so the amount of VLOOKUPs in column 2 is 3).

COLUMN1 COLUMN2
ROW1 VLOOKUP
ROW2 VLOOKUP
ROW3 VLOOKUP

What I don't want is this: (i.e. there are more VLOOKUPs in column 2 than there are bits of data in column 1)
COLUMN1 COLUMN2
ROW1 VLOOKUP
ROW2 VLOOKUP
ROW3 VLOOKUP
VLOOKUP
VLOOKUP

So, in essence, I need a VLOOKUP against each row of data that exists. So, if there are 50 rows of data then I would need there to be 50 VLOOKUPs and if there's only 35 rows of data then I would need there to be 35 VLOOKUPs. However, I won't know from one day to the next how many rows will be required, so I need the amount of VLOOKUPs to be dynamic if that makes sense.

Many thanks
Jon
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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