Data Extraction from a single large table with formulae or VBA (VLOOKUP? MATCH? INDEX)

seattletimebandit

Board Regular
Joined
Apr 11, 2013
Messages
69
Hello all,


I've got some data in a table (346 rows, 13 columns). I need to pull specific data from the range of cells based on the left-most column/rows (SampleID) and the column headers (Chemical Name).


Truncated table:


SampleIDDateBenzeneEthylbenzenem,p-Xyleneo-XyleneTolueneGasolinecis-1,2-DCEPCEtrans-1,2-DCETCEVC
Sample11/10/140.0252 U0.3080.03280.0252 U0.0252 U6.30 U
Sample21/10/140.02470.04880.09530.03310.0224 U1790.0209 U0.03400.0209 U0.0209 U0.0021 U
Sample31/10/1429.515349663.02.719,5800.0177 U0.0177 U0.0177 U0.0177 U0.0018 U
Sample41/10/140.04510.1180.1460.0234 U0.0234 U2330.0257 U0.2160.0257 U0.0257 U0.0026 U
Sample51/10/140.3442.932.230.06080.0213 U235
Sample61/10/140.0195 U0.0292 U0.03990.02140.0195 U4.87 U

<tbody>
</tbody>



The output would be:


Sample11/10/14
Benzene0.0252 U
Ethylbenzene0.308
m,p-Xylene0.0328
o-Xylene0.0252 U
Toluene0.0252 U

<tbody>
</tbody>

Sample21/10/14
Benzene0.0247
Ethylbenzene0.0488
m,p-Xylene0.0953
o-Xylene0.0331
Toluene0.0224 U

<tbody>
</tbody>

Sample31/10/14
Benzene29.5
Ethylbenzene153
m,p-Xylene496
o-Xylene63.0
Toluene2.71

<tbody>
</tbody>


etc.




The output tables will be used as an overlay on an AutoCad map of a contaminated site with each ouput table pointing (with and arrow) to a monitoring well where the sample was collected.


I thought I could do this with VLOOKUP, but I'm not finding it to be workable. It would be nice to have several output tables be created for each SampleID, and also changing up the Chemical Name, either by a drop-down box to "build" the output table, one SampleID at a time, or choosing X number of Sample ID's and generating as many tables as the user wants. Either in the same worksheet of a new worksheet.


Thanks!


stb
 
Sorry, the bust was in my head. :confused:

I didn't notice that it was changing the chemical names. It works perfectly, it skips blank cells and when it hits a value in the cell, it uses the correct header cell as the chemical name. Sweet!
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Sorry, the bust was in my head. :confused:

I didn't notice that it was changing the chemical names. It works perfectly, it skips blank cells and when it hits a value in the cell, it uses the correct header cell as the chemical name. Sweet!

Happy to hear that. Thanks for providing feedback.
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,354
Members
449,155
Latest member
ravioli44

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