Extract Data from a large table

dmb41

Board Regular
Joined
Nov 10, 2010
Messages
75
I am looking to take a small amount of data (onto a separate sheet) by extracting it from a large table.

I am working of of formulas (by altering them) from a different, but very similar project which worked very well.

For simplicity I will tone down the set of data.

Sheet1 consists of the following:


AA1 BB2 CC3
TT45 45 15 84
HH41 21 100 185
FF87 47 5 204
TT89 12 78 890
GG84 2 14 780

Basically a simple matrix. No formulas needed here.

Sheet 2

I am looking to take data from sheet1 for a more straight-forward view


2 3
BB2 CC3
4 TT89 #VALUE! #VALUE!
1 TT45 #VALUE! #VALUE!

The first row gives which columns the text string falls into:
e.g. BB2 is the 2nd column in that set (this is later used in formulation):
The 2 is found from the following:

Code:
=IF(C3="","",MATCH(C3,Sheet1!$B$2:$D$2,0))
3 the same way.

The first column works the same by given which row it falls into (on sheet1)

Found:
Code:
=IF(B5="","",MATCH(B5,Sheet1!$A$3:$A$6,0))

The problem is I cant seem to get the index (i.e. BB2 is in column2, TT89 is in row4, therefore the number it should be grabbing is '78' from sheet1

This also uses a module (and assumes headers):
Function Com(rng As Range) As String
Dim Rw As Range
Dim txt As String
For Each Rw In rng
txt = txt & Rw & ", "
Next Rw
Com = Left(txt, Len(txt) - 2)
End Function

I might be making this more difficult than it is, and there could be a quicker way to complete it
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi is this what you want? Although im working in the same sheet you can easily adapt to work in another sheet. Copy across and down the formula.

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;"></td><td style="background-color: #FFFF00;;">AA1</td><td style="background-color: #FFFF00;;">BB2</td><td style="background-color: #FFFF00;;">CC3</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="background-color: #FFFF00;;">BB2</td><td style="background-color: #FFFF00;;">CC3</td><td style="text-align: right;background-color: #FFFF00;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="background-color: #FFFF00;;">TT45</td><td style="text-align: right;;">45</td><td style="text-align: right;;">15</td><td style="text-align: right;;">84</td><td style="text-align: right;;"></td><td style="background-color: #FFFF00;;">TT89</td><td style="text-align: right;;">78</td><td style="text-align: right;;">890</td><td style=";"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="background-color: #FFFF00;;">HH41</td><td style="text-align: right;;">21</td><td style="text-align: right;;">100</td><td style="text-align: right;;">185</td><td style="text-align: right;;"></td><td style="background-color: #FFFF00;;">TT45</td><td style="text-align: right;;">15</td><td style="text-align: right;;">84</td><td style=";"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="background-color: #FFFF00;;">FF87</td><td style="text-align: right;;">47</td><td style="text-align: right;;">5</td><td style="text-align: right;;">204</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: #FFFF00;;"></td><td style=";"></td><td style=";"></td><td style=";"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="background-color: #FFFF00;;">TT89</td><td style="text-align: right;;">12</td><td style="text-align: right;;">78</td><td style="text-align: right;;">890</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: #FFFF00;;"></td><td style=";"></td><td style=";"></td><td style=";"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="background-color: #FFFF00;;">GG84</td><td style="text-align: right;;">2</td><td style="text-align: right;;">14</td><td style="text-align: right;;">780</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: #FFFF00;;"></td><td style=";"></td><td style=";"></td><td style=";"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet8</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G2</th><td style="text-align:left">=IFERROR(<font color="Blue">INDEX(<font color="Red">$B$2:$D$6,MATCH(<font color="Green">$F2,$A$2:$A$6,0</font>),MATCH(<font color="Green">G$1,$B$1:$D$1,0</font>)</font>),""</font>)</td></tr></tbody></table></td></tr></table><br />
 
Last edited:
Upvote 0
Thanks MrVillareal , that is exactly what I was looking for. It was easy to adapt to two seperate sheets also. Now I just need to alter for the larger data set.

Thanks for your time!
 
Upvote 0

Forum statistics

Threads
1,224,604
Messages
6,179,857
Members
452,948
Latest member
UsmanAli786

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