PDA

View Full Version : Some kind of lookup or macro??



wa1esy
11-10-2010, 04:11 AM
Hi All

I am in need of an urgent formula or perhaps some code to perform a relatively simple function in Excel 2007. Basically I have a huge amount of data in rows that I need to get into a table, but I just can't for the life of me figure out how to do it! :dunno

I have attached an example workbook. Tab 1 is the data as I have it (I have shaded the cells for reference, they do not have a fill normally), and Tab 2 is the table I want to put it in to.

Basically I have a list of the yellow cells, and I need some kind of formula or macro that can look down the data in tab one and match the data in my list to the cell in the tab 1 and then retrieve the cell immediately above and immediately below it and enter this in my table.

Does anyone have any ideas on how to do this? I thought vlookup but it won't work because my data is in rows and not in columns???

Any help gratefully appreciated.:help

Bob Phillips
11-10-2010, 05:26 AM
Try

=INDEX('Raw Data'!$A:$A,MATCH($A2,'Raw Data'!$A:$A,0)-1)

and

=INDEX('Raw Data'!$A:$A,MATCH($A2,'Raw Data'!$A:$A,0)+1)