Text & Number String Extraction Without VBA

jawnathin

New Member
Joined
Nov 27, 2013
Messages
8
Hello all,

Long-time reader, first-time poster. I need to find and extract a string from a text field that consists of two letters followed by three numbers (XX000) then nest that inside a VLOOKUP to return another corresponding cell of data. There are hundreds of rows of data that need this applied to them Sample data below:

CreatedCommentDesired Extraction
1/1/2013Bananas BA426 Them more textBA426
5/1/2013Apples AP654 More additional textAP654
6/3/2013More Fruit MF055 Even more textMF055
7/5/2013More Text Before Numbers MT323 and this one is going to be really long to prove a point. ;)MT323

<tbody>
</tbody>

The VLOOKUP with the XX000 string is easy; pulling that string using a formula and no VBA is the hard part. Someone please tell me there's an easy way that I'm simply overlooking!

Edit: I just discovered that I may also have a master list of the strings that are embedded in the Comment column. Sample below:


CodePurchaser
BA426Jill
AP654Adam
MF055Fred
MT323Charles


<tbody>
</tbody>

So the end goal is to find the purchaser (Table 2) from the code (Table 1 & 2) taken from the text field (Table 1).

Thanks to everyone who checks this out!

____________
Jawnathin
 
Last edited:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Something like this should work for the first part, Excel 2010
A
B
C
1
01/01/2013
Bananas BA426 Them more text
BA426
2
05/01/2013
Apples AP654 More additional text
AP654
3
06/03/2013
More Fruit MF055 Even more text
MF055
4
07/05/2013
More Text Before Numbers MT323 and this one is going to be really long to prove a point.
MT323

<tbody>
</tbody>
Sheet2


Array Formulas
Cell
Formula
C1
{=MID(B1,MATCH(TRUE,ISNUMBER(1*MID(B1,ROW(INDIRECT("1:"&LEN(B1))),1)),0)-2,5)}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Finally you have something like this, in my data, the lookup table is in A7:B11, change as requiredExcel 2010
ABC
101/01/2013Bananas BA426 Them more textJill
205/01/2013Apples AP654 More additional textAdam
306/03/2013More Fruit MF055 Even more textFred
407/05/2013More Text Before Numbers MT323 and this one is going to be really long to prove a point.Charles
5
6
7CodePurchaser
8BA426Jill
9AP654Adam
10MF055Fred
11MT323Charles

<colgroup><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Array Formulas
CellFormula
C1{=VLOOKUP(MID(B1,MATCH(TRUE,ISNUMBER(1*MID(B1,ROW(INDIRECT("1:"&LEN(B1))),1)),0)-2,5),A7:B11,2,0)}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,421
Messages
6,119,392
Members
448,891
Latest member
tpierce

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