PPRuNe Forums - View Single Post - Excel chart
Thread: Excel chart
View Single Post
Old 27th Feb 2012, 07:17
  #11 (permalink)  
ExGrunt
 
Join Date: Mar 2003
Location: England
Posts: 286
Likes: 0
Received 0 Likes on 0 Posts
BH,

Yes, I would use INDEX and MATCH - which are available in Excel 2003.

The main caveat is that the search values MUST BE unique, otherwise MATCH will just return the first matching value it encounters.

Here is a short example:

In cells C2:C5 enter 1,2,3,4.

In cells D2:D5 enter Apple, Bananna, Orange, Pear.

In cell C8 enter 1.

In cell D8 enter: =INDEX(D2:D5,MATCH(C8,C2:C5,0),1)

Where:

D2:D5 is the data array
C8 is the search value
C2:C5 is the search array
0 sets the search to an exact match
1 returns the data from the first column in the data array

You will see that by changing the value in C8 the corresponding value is returned in D8.

The above references are relative references and so will change when the formula is copied to other cells. So it is better practice to use absolute references (ie $D$2:$D$5) or (my preference) named ranges for the data and search arrays, but that is a level of complexity that I will leave out of this example.


HTH

EG
ExGrunt is offline