Extracting characters from String

jason_1

New Member
Joined
Aug 11, 2009
Messages
10
I have a list fo ref numbers and need to extract the first 6 minus the H into the next cell, they are formatted as:

<TABLE style="WIDTH: 72pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=96 x:str><COLGROUP><COL style="WIDTH: 72pt; mso-width-source: userset; mso-width-alt: 3510" width=96><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #c0c0c0; BORDER-LEFT: #c0c0c0; BACKGROUND-COLOR: transparent; WIDTH: 72pt; HEIGHT: 12.75pt; BORDER-TOP: #c0c0c0; BORDER-RIGHT: #c0c0c0" class=xl24 height=17 width=96>H15383200101</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #c0c0c0; BORDER-LEFT: #c0c0c0; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #c0c0c0; BORDER-RIGHT: #c0c0c0" class=xl24 height=17>H47832900101</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #c0c0c0; BORDER-LEFT: #c0c0c0; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #c0c0c0; BORDER-RIGHT: #c0c0c0" class=xl24 height=17>H52032300101</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #c0c0c0; BORDER-LEFT: #c0c0c0; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #c0c0c0; BORDER-RIGHT: #c0c0c0" class=xl24 height=17>H47822700101</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #c0c0c0; BORDER-LEFT: #c0c0c0; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #c0c0c0; BORDER-RIGHT: #c0c0c0" class=xl24 height=17>H90000600101</TD></TR></TBODY></TABLE>

Is the a simple way to do this?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

doofusboy

Well-known Member
Joined
Oct 14, 2003
Messages
1,325
Assuming your data is in column A, put this formula in column B:

=RIGHT(LEFT(A1,6),5)
 

Glob

New Member
Joined
Aug 5, 2010
Messages
2
Assuming your data is in column A, put this formula in column B:

=RIGHT(LEFT(A1,6),5)

From reading the original post, since he wants the first 6 numbers after the "H", the above code is close, but only showing the first 5 numbers after the "H". A simple fix would be to change the "6" to a "7" and change the "5" to a "6" or

Code:
=RIGHT(LEFT(A1,7),6)

Also, the post 2 above this one works

Code:
=MID(A1,2,6)
 

Watch MrExcel Video

Forum statistics

Threads
1,133,635
Messages
5,659,989
Members
418,540
Latest member
vecia92

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
Top