dynamic index match to replace vlookup

0

I can make a vlookup "dynamic" by changing the column index... and easily get entire column from the "database"... i can choose any keys in any order.

this is the data table + and the lookup: this is the data table + and the lookup table

and these are the formulas behind: and these are the formulas behind

my question if the dynamic vlookup formula e. g vlookup($g5, $A:$E, J$4,false)... can be converted into index-match? e.g.index(E:E, match(A8, A:A, 0))

how can i get the A and E column without loosing the performence benefit of index-match?

Asaf

Posted 2017-01-10T10:19:35.907

Reputation: 105

Can you include the column letters and row numbers in your picture? (As an aside, you probably have the snipping tool available for taking a screenshot.) – nickflees – 2017-01-10T15:12:34.007

I've already deleted it- it was just an example to explain my need... if anyone needs them they can be easily deduced from the formulas. – Asaf – 2017-01-10T15:22:14.527

I'm pointing out that you need to learn how to ask the question the right way for a Stack Exchange community. Nobody here wants to spend the time to "deduce" the details of the problem to help you with your failure to understand the most basic elements of Excel if you're not willing to give them easy access to the information they need to help you. – nickflees – 2017-01-10T15:30:31.627

I was looking for an excel function - not someone that will do my work. I'm sorry for making you angry. I cant understand why the collums matter. But i sincerly appreciate your effot to help. thanks Asaf – Asaf – 2017-01-10T15:39:03.183

Answers

2

Use the OFFSET function.

OFFSET takes a range as input, then returns a range that is a specified number of rows down, columns to the right, and a certain width and height. In this case, and assuming the data in your screenshot is backwards, we'd use something like this:

=INDEX(OFFSET($A:$A,0, J$4-1),MATCH($G5,$A:$A,0))

The OFFSET takes three arguments (it allows for five, but we're only using three here). The first is the start point - in this case, A:A. The second is the number of rows to move down - in this case, 0. The third is the number of columns to move to the right. This is where we're doing the work, by pulling the reference number from row 4 and moving across by that number of columns (-1, to account for the fact that column 1 = 0 columns of movement for our reference).

Werrf

Posted 2017-01-10T10:19:35.907

Reputation: 769

I think that offset is a volatile function. Since I need this formula to run on ~1million cells... I need to be efficient – Asaf – 2017-01-10T13:44:43.210

You're really not going to find anything very 'efficient' doing database functions in Excel. You may be better off using a database application. – Werrf – 2017-01-10T13:52:09.973

very good advice... but my boss like the safety of his excel. :( he doesnt need a professional to maintain his little db...if the professional run away... he can do the work himself. – Asaf – 2017-01-10T13:59:20.650

@Asaf I've seen plenty of ad-hoc databases grown in Excel that quickly become completely incomprehensible and unmanageable. Your boss is going to have to live with these inefficiencies if they don't want to use the right tool for the job. – Dranon – 2017-01-10T15:07:26.030