Optimization of vlookup with multiple criteria (index + match)

Waldir Leoncio picture Waldir Leoncio · Aug 14, 2013 · Viewed 9.5k times · Source

I have a 12x18 Excel range which draws data from a 823x20 sheet (Results!$A:$T) according to the 12x18 range's page, row and column headers (criterion1, criterion2 and criterion3, respectively)

={INDEX(Results!$A:$T,
        MATCH(1, (criterion1 = Results!$A:$A) * (criterion2 = Results!$B:$B), 0),
        MATCH(criterion3, Results!$A$1:$T$1, 0))}

As you can see, it's not that much data, but still, when I change the page header, my computer (2 GHz Intel Xeon with 24 GB of RAM) takes about a minute to update the 216 (12x18) index searches and I'm not even half way done with creating searches.

Earlier on my project, these searches only had one criterion, so I used VLOOKUP() and the results came very quickly. However, now I need to find values according to three criteria, and the function above is the best way I've managed to accomplish this. However, it seems to be the responsible for the long computation times I'm getting. So my question is: how can I optimize a VLOOKUP() of multiple criteria? Should I tweak INDEX(1, MATCH()*MATCH(), MATCH()) or is there a faster way to do this?

Here's a sample of the 12x18 index searches (branch name is the only variable that the end-user will be able to change):

Index

And of the 823x20 sheet it searches (column A has no merges, actually):

enter image description here

Answer

For a summary and options for Lookup with multiple criteria you may check this.

I use a lot Method 2 here (it is non-array formula) and method here.

I guess you should try them to check their speed.