Remove Spaces

Manny74

Board Regular
Joined
May 6, 2016
Messages
124
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi All,

My data is supposed to look a certain way ( see below)

I need to remove spaces between D, the ID # (for example DXH110817) and the last name Doe.

I'm trying to find an efficient fast way of doing this since I have about 50 records in my data.

Any suggestions?

So right now, it looks like this:

[TABLE="width: 243"]
<tbody>[TR]
[TD]D[/TD]
[TD] DXH110817 DOE JOHN[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD] RXP011916 DOE JANE[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD] 173616018 DOE JAKE[/TD]
[TD][/TD]
[TD] [/TD]
[/TR]
[TR]
[TD][/TD]
[TD]
But it should look like this: [TABLE="width: 178"]
<tbody>[TR]
[TD]DDXH110817DOE[/TD]
[TD]JOHN[/TD]
[/TR]
[TR]
[TD]DRXP011916DOE[/TD]
[TD]JANE[/TD]
[/TR]
[TR]
[TD]D173616018DOE[/TD]
[TD]JAKE[/TD]
[/TR]
</tbody><colgroup><col><col></colgroup>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col><col><col></colgroup>[/TABLE]
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi, Are the Columns/Rows of data going to be static or variable? Also is there any other data within the sheet?
 
Upvote 0
Hi,

If your data is Always in the structure as your samples, you can use this formula:


Book1
AB
1D DXH110817 DOE JOHNDDXH110817DOE JOHN
2D RXP011916 DOE JANEDRXP011916DOE JANE
3D 173616018 DOE JAKED173616018DOE JAKE
Sheet65
Cell Formulas
RangeFormula
B1=SUBSTITUTE(SUBSTITUTE(A1," ","",1)," ","",1)
 
Upvote 0
I believe static.

So the data looks like this:

[TABLE="width: 711"]
<tbody>[TR]
[TD]D[/TD]
[TD]DXH110817[/TD]
[TD]DOE[/TD]
[TD]JOHN[/TD]
[TD]X[/TD]
[TD]20171108[/TD]
[TD]06[/TD]
[TD]Z20.6[/TD]
[TD="align: right"]20171213[/TD]
[TD]958577066[/TD]
[TD]XHV[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]RXP011916[/TD]
[TD]DOE[/TD]
[TD]JANE[/TD]
[TD]X[/TD]
[TD]20160119[/TD]
[TD]06[/TD]
[TD]Z20.6[/TD]
[TD="align: right"]20171017[/TD]
[TD]954772357[/TD]
[TD]XHV[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]173616018[/TD]
[TD]DOE[/TD]
[TD]JUDE[/TD]
[TD]L[/TD]
[TD]20150327[/TD]
[TD]06[/TD]
[TD]Z21[/TD]
[TD="align: right"]20170403[/TD]
[TD]953854210[/TD]
[TD]XHV[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]AEO110613[/TD]
[TD]DOE[/TD]
[TD]JILL[/TD]
[TD]E[/TD]
[TD]20131106[/TD]
[TD]06[/TD]
[TD]B20[/TD]
[TD]20150922[/TD]
[TD]952860686[/TD]
[TD]XHV[/TD]
[/TR]
</tbody><colgroup><col span="2"><col><col><col span="2"><col><col><col span="2"><col></colgroup>[/TABLE]
 
Upvote 0
And it should look like this:

[TABLE="width: 492"]
<tbody>[TR]
[TD]DDXH110817DOE[/TD]
[TD]JOHN[/TD]
[TD]X2017110806Z20.6[/TD]
[TD]20171213[/TD]
[TD]958577066XHV[/TD]
[/TR]
[TR]
[TD]DRXP011916DOE[/TD]
[TD]JANE[/TD]
[TD]X2016011906Z20.6[/TD]
[TD]20171017[/TD]
[TD]954772357XHV[/TD]
[/TR]
[TR]
[TD]D173616018DOE[/TD]
[TD]JUDE[/TD]
[TD]L2015032706Z21[/TD]
[TD]20170403[/TD]
[TD]953854210XHV[/TD]
[/TR]
[TR]
[TD]DAEO110613DOE[/TD]
[TD]JILL[/TD]
[TD]E2013110606B20[/TD]
[TD]20150922[/TD]
[TD]952860686XHV[/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col></colgroup>[/TABLE]
 
Upvote 0
Is each line of data string in ONE cell?
 
Upvote 0
The data looks like this:

[TABLE="width: 912"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD] C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]DXH110817[/TD]
[TD] DOE[/TD]
[TD]JOHN[/TD]
[TD]X[/TD]
[TD]20171108[/TD]
[TD]06[/TD]
[TD]Z20.6[/TD]
[TD]20171213[/TD]
[TD]958577066[/TD]
[TD]XHV[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]RXP011916[/TD]
[TD] DOE[/TD]
[TD]JANE[/TD]
[TD]X[/TD]
[TD]20160119[/TD]
[TD]06[/TD]
[TD]Z20.6[/TD]
[TD]20171017[/TD]
[TD]954772357[/TD]
[TD]XHV[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]173616018[/TD]
[TD] DOE[/TD]
[TD]JUDE[/TD]
[TD]L[/TD]
[TD]20150327[/TD]
[TD]06[/TD]
[TD]Z21[/TD]
[TD]20170403[/TD]
[TD]953854210[/TD]
[TD]XHV[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]AEO110613[/TD]
[TD] DOE[/TD]
[TD]JILL[/TD]
[TD]E[/TD]
[TD]20131106[/TD]
[TD]06[/TD]
[TD]B20[/TD]
[TD]20150922[/TD]
[TD]952860686[/TD]
[TD]XHV[/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col span="3"><col span="3"></colgroup>[/TABLE]
 
Upvote 0
Are you looking to REPLACE the original data as the way you show in Post #5 ?
Or, can we place the NEW modified string in other Columns/Cells?
Also, the way you want the results in Post #5 , is that each line in ONE cell, or are they in separate Columns?

Are you looking for Formula, or VBA?
 
Upvote 0
Are you looking to REPLACE the original data as the way you show in Post #5 ?
Or, can we place the NEW modified string in other Columns/Cells?
Also, the way you want the results in Post #5 , is that each line in ONE cell, or are they in separate Columns?

Are you looking for Formula, or VBA?

I'm looking to remove spaces in between columns (cells).....
I'm going from 11 columns to about 5 columns....
I'm looking for a formula...
 
Upvote 0
Then it's pretty straight forward:


Book1
ABCDEFGHIJKLMNOP
1DDXH110817DOEJOHNX201711086Z20.620171213958577066XHVDDXH110817DOE JOHNX201711086Z20.620171213958577066XHV
2DRXP011916DOEJANEX201601196Z20.620171017954772357XHVDRXP011916DOE JANEX201601196Z20.620171017954772357XHV
3D173616018DOEJUDEL201503276Z2120170403953854210XHVD173616018DOE JUDEL201503276Z2120170403953854210XHV
4DAEO110613DOEJILLE201311066B2020150922952860686XHVDAEO110613DOE JILLE201311066B2020150922952860686XHV
Sheet65
Cell Formulas
RangeFormula
M1=CONCATENATE(A1,B1,C1," ",D1)
N1=E1&F1&G1&H1
O1=I1
P1=J1&K1


Formulas copied down.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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