vlookup

tlindeman

Active Member
Joined
Jun 29, 2005
Messages
313
I need a vlookup that ignores spaces. For example in my sheet "ENTERPRISE KPI" in cell A5, I have "Total Stockholder's Equity" , I want to look that up on the sheet "11-02 Statements" cells A:B. The problem is in cell A, there is total stock holder's equity in a cells, however, there is 5 spaces before the T. THe sheet "11-02 Statements" I can not change. is there a way to do a lookup based on the text and not the exact cell contents? I know I probably did not explain that very well so please let me know if you have more questions.

Thank you
Tony
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I need a vlookup that ignores spaces. For example in my sheet "ENTERPRISE KPI" in cell A5, I have "Total Stockholder's Equity" , I want to look that up on the sheet "11-02 Statements" cells A:B. The problem is in cell A, there is total stock holder's equity in a cells, however, there is 5 spaces before the T. THe sheet "11-02 Statements" I can not change. is there a way to do a lookup based on the text and not the exact cell contents? I know I probably did not explain that very well so please let me know if you have more questions.

Thank you
Tony

Hi Tony,

Do you mean that on one sheet you have " Total Stockholder's Equity" (ie with 5 spaces before) and on another you have "Total Stockholder's Equity"?

You could try using TRIM within your vlookup...

Code:
=VLOOKUP(TRIM(A5),etc....

If that doesn't make sense then post examples of what you are trying to achieve and i'll have a go... :)
 
Upvote 0
You are going to need to do this with an array-entered index/match formula:

<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 /></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></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">     Total Stockholder's Equity</td><td style="text-align: right;;">153</td><td style="text-align: right;;"></td><td style=";">Value to Find</td><td style=";">Total Stockholder's Equity</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">     Stuff</td><td style="text-align: right;;">123</td><td style="text-align: right;;"></td><td style=";">Value Returned</td><td style="text-align: right;;">153</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>Array 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">E2</th><td style="text-align:left">{=INDEX(<font color="Blue">B1:B2,MATCH(<font color="Red">E1,TRIM(<font color="Green">A1:A2</font>),0</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 
Upvote 0
Is there ALWAYS 5 spaces before the text value in Column A?

If so you can do

=VLOOKUP("xxxxx"&A5,etc...)

The xxxxx is supposed to be 5 spaces, the board software trimmed it...
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

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