vlookup in entire column vs. vlookup in dynamic named range

pravit

New Member
Joined
Jan 27, 2009
Messages
11
What would be faster - doing an exact match VLOOKUP in an entire column, e.g. VLOOKUP(A1, B:C, 2, 0) or creating a dynamic named range in columns B and C with a formula that searches the entire column to find the last used row, e.g.
=OFFSET($B$1, 0, 0, MATCH("*",$B:$B,-1), 2)

and then having each VLOOKUP search in this named range? Is the MATCH in the named range formula calculated each time for each VLOOKUP?

What if I were to have another cell, say D1 and set it equal to
=MATCH("*",$B:$B,-1)

then define the named range as
=OFFSET($B$1, 0, 0, $D$1, 2)

Would that be faster at all? If I am in a sheet set to manual calculation, would that even work since D1 needs to be calculated before the range is set?

Thanks.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
What would be faster - doing an exact match VLOOKUP in an entire column, e.g. VLOOKUP(A1, B:C, 2, 0) or creating a dynamic named range in columns B and C with a formula that searches the entire column to find the last used row, e.g.
=OFFSET($B$1, 0, 0, MATCH("*",$B:$B,-1), 2)

and then having each VLOOKUP search in this named range? Is the MATCH in the named range formula calculated each time for each VLOOKUP?

What if I were to have another cell, say D1 and set it equal to
=MATCH("*",$B:$B,-1)

then define the named range as
=OFFSET($B$1, 0, 0, $D$1, 2)

Would that be faster at all? If I am in a sheet set to manual calculation, would that even work since D1 needs to be calculated before the range is set?

Thanks.

If B:C is (can be) sorted in ascending order...

=IF(VLOOKUP(A1, B:B, 1, 1)=A1,VLOOKUP(A1, B:C, 2, 1),"")

would be a lot faster than

=VLOOKUP(A1, B:C, 2, 0)

If B:C is a 1000 row area...

=VLOOKUP(A1, B2:C1000, 2, 0)

will be faster than

=VLOOKUP(A1, B:C, 2, 0)

Given such a difference, defining a dynamic named range for a slowly growing table area in B:C might show a positive payoff.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,757
Members
448,991
Latest member
Hanakoro

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