Can VLookup do this?

CharlieBeth

New Member
Joined
Sep 28, 2011
Messages
18
Search through a whole page with tables like this (sorry, bad pasting), find a name (e.g. Shaun G) and the amount (in this case £43.28) and display them together?

<table border="0" cellpadding="0" cellspacing="0" width="680"><col style="width: 128pt;" span="4" width="170"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt; width: 128pt;" height="17" width="170">Cleaner 1</td> <td class="xl24" style="width: 128pt;" width="170">Cleaner 2</td> <td class="xl24" style="width: 128pt;" width="170">Cleaner 3</td> <td class="xl24" style="width: 128pt;" width="170">Cleaner 4</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt;" height="17">Shaun G</td> <td class="xl27" style="border-left: medium none;">Ryan B</td> <td class="xl27" style="border-left: medium none;">Wayne M</td> <td class="xl27" style="border-left: medium none;">Emma C</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">X</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">
</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">
</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">
</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" height="17">
</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">
</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">
</td> <td class="xl25" style="border-top: medium none; border-left: medium none;">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl26" style="height: 12.75pt; border-top: medium none;" height="17">£43.28</td> <td class="xl26" style="border-top: medium none; border-left: medium none;">£16.85</td> <td class="xl26" style="border-top: medium none; border-left: medium none;">£17.80</td> <td class="xl26" style="border-top: medium none; border-left: medium none;">£12.10</td> </tr> </tbody></table>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
vlookup can't hlookup can.

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;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></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Cleaner 1</td><td style=";">Cleaner 2</td><td style=";">Cleaner 3</td><td style=";">Cleaner 4</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">Shaun G</td><td style=";">Ryan B</td><td style=";">Wayne M</td><td style=";">Emma C</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Name</td><td style=";">Amount</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Shaun G</td><td style="text-align: right;;">43.28</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">£43.28</td><td style="text-align: right;;">£16.85</td><td style="text-align: right;;">£17.80</td><td style="text-align: right;;">£12.10</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></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 #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</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: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;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: #E0E0F0;color: #161120">H3</th><td style="text-align:left">=HLOOKUP(<font color="Blue">G3,$A$2:$D$4,3,FALSE</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
vlookup can't hlookup can.

Excel 2007<table style="background-color: rgb(255, 255, 255); border: 1px solid rgb(166, 170, 182); border-collapse: collapse;" cellpadding="2.5px" rules="all"><colgroup><col style="background-color: rgb(224, 224, 240);" width="25px"><col><col><col><col><col><col><col><col></colgroup><thead><tr style="background-color: rgb(224, 224, 240); text-align: center; color: rgb(22, 17, 32);"><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></tr></thead><tbody><tr><td style="color: rgb(22, 17, 32); text-align: center;">1</td><td style="">Cleaner 1</td><td style="">Cleaner 2</td><td style="">Cleaner 3</td><td style="">Cleaner 4</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td></tr><tr><td style="color: rgb(22, 17, 32); text-align: center;">2</td><td style="">Shaun G</td><td style="">Ryan B</td><td style="">Wayne M</td><td style="">Emma C</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="">Name</td><td style="">Amount</td></tr><tr><td style="color: rgb(22, 17, 32); text-align: center;">3</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="">Shaun G</td><td style="text-align: right;">43.28</td></tr><tr><td style="color: rgb(22, 17, 32); text-align: center;">4</td><td style="text-align: right;">£43.28</td><td style="text-align: right;">£16.85</td><td style="text-align: right;">£17.80</td><td style="text-align: right;">£12.10</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td><td style="text-align: right;">
</td></tr></tbody></table>
Sheet1


<table style="border: 2px solid black; border-collapse: collapse; padding: 0.4em; background-color: rgb(255, 255, 255);" cellpadding="2.5px" rules="all" width="85%"><tbody><tr><td style="padding: 6px;">Worksheet Formulas<table style="border: 1px solid rgb(166, 170, 182); text-align: center; background-color: rgb(255, 255, 255); border-collapse: collapse;" cellpadding="2.5px" rules="all" width="100%"><thead><tr style="background-color: rgb(224, 224, 240); color: rgb(22, 17, 32);"><th width="10px">Cell</th><th style="text-align: left; padding-left: 5px;">Formula</th></tr></thead><tbody><tr><th style="background-color: rgb(224, 224, 240); color: rgb(22, 17, 32);" width="10px">H3</th><td style="text-align: left;">=HLOOKUP(G3,$A$2:$D$4,3,FALSE)</td></tr></tbody></table></td></tr></tbody></table>

Thanks for the reply. I'm something of a beginner... what is the '3' before the FALSE?
 
Upvote 0

Forum statistics

Threads
1,224,545
Messages
6,179,432
Members
452,915
Latest member
hannnahheileen

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