VBA to do two way lookup

MrsFraser07

New Member
Joined
Aug 16, 2017
Messages
41
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi there,

I have a very slow spreadsheet that is fairly formula intensive. It is alot of two-way lookups. I'm thinking that VBA code would speed things up, but I have no idea how to do that. Here is an example of one of my two-way lookup formulas:

{=IFERROR(INDEX(Sheet1!F:F,MATCH(A2&$F$1,Sheet1!A:A&Sheet1!D:D,0)),0)}

So, basically I want to return a value in column F from Sheet1 that matches cell A2 and F1 in columns A & D in Sheet1. I want the lookup in cell F1 to stay absolute, but the lookup in A2 to go down the list ie. A3, A4, A5, Etc. until it gets to the end of my column.

Hope that makes sense. I wish I could attach my spreadsheet, but I don't see an attachment upload. Thanks in advance for your help!

Shari
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
VBA wouldn't speed it up that much. The quickest way would be to insert a helper column to the left of Sheet1!F:F with the formula =A1&D1 and then do a VLOOKUP on that added column.
 
Upvote 0
Thanks. I'll give that a try. It has 30,000+ rows so it is quite slow.
 
Upvote 0
30,000 rows with array formulas would be pretty slow. With that much data, it would be faster to install helper columns and use non-volatile, non-array formulas throughout.
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,993
Members
448,539
Latest member
alex78

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