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]
 
Oops, I missed the part where you said 5 columns (not 4):


Book1
ABCDEFGHIJKLMNOPQ
1DDXH110817DOEJOHNX201711086Z20.620171213958577066XHVDDXH110817DOEJOHNX201711086Z20.620171213958577066XHV
2DRXP011916DOEJANEX201601196Z20.620171017954772357XHVDRXP011916DOEJANEX201601196Z20.620171017954772357XHV
3D173616018DOEJUDEL201503276Z2120170403953854210XHVD173616018DOEJUDEL201503276Z2120170403953854210XHV
4DAEO110613DOEJILLE201311066B2020150922952860686XHVDAEO110613DOEJILLE201311066B2020150922952860686XHV
Sheet65
Cell Formulas
RangeFormula
M1=A1&B1&C1
N1=D1
O1=E1&F1&G1&H1
P1=I1
Q1=J1&K1
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Concatenate works! Thanks!

But in doing so, column G (06) should have 2 digits (zero and six), and when I concatenate, it removes the zero (0) and leaves it as 6....And I need the 06 as part of the data....

ABCDEFGHIJKLMNOP
DDXH110817DOEJOHNXZ20.6XHVDDXH110817DOE JOHNX201711086Z20.6958577066XHV
DRXP011916DOEJANEXZ20.6XHVDRXP011916DOE JANEX201601196Z20.6954772357XHV
DDOEJUDELZ21XHVD173616018DOE JUDEL201503276Z21953854210XHV
DAEO110613DOEJILLEB20XHVDAEO110613DOE JILLE201311066B20952860686XHV

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"]20171108[/TD]
[TD="align: right"]06[/TD]

[TD="align: right"]20171213[/TD]
[TD="align: right"]958577066[/TD]

[TD="align: right"][/TD]

[TD="align: right"]20171213[/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]20160119[/TD]
[TD="align: right"]06[/TD]

[TD="align: right"]20171017[/TD]
[TD="align: right"]954772357[/TD]

[TD="align: right"][/TD]

[TD="align: right"]20171017[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]173616018[/TD]

[TD="align: right"]20150327[/TD]
[TD="align: right"]06[/TD]

[TD="align: right"]20170403[/TD]
[TD="align: right"]953854210[/TD]

[TD="align: right"][/TD]

[TD="align: right"]20170403[/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]20131106[/TD]
[TD="align: right"]06[/TD]

[TD="align: right"]20150922[/TD]
[TD="align: right"]952860686[/TD]

[TD="align: right"][/TD]

[TD="align: right"]20150922[/TD]

</tbody>
Sheet65

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]M1[/TH]
[TD="align: left"]=CONCATENATE(A1,B1,C1," ",D1)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]N1[/TH]
[TD="align: left"]=E1&F1&G1&H1[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]O1[/TH]
[TD="align: left"]=I1[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]P1[/TH]
[TD="align: left"]=J1&K1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



Formulas copied down.[/QUOTE]
 
Upvote 0
Is your G Column formatted as Text? Is it already showing the value as 06 ?

Seems to be working for me...


Book1
ABCDEFGHIJKLMNOPQ
1DDXH110817DOEJOHNX2017110806Z20.620171213958577066XHVDDXH110817DOEJOHNX2017110806Z20.620171213958577066XHV
2DRXP011916DOEJANEX2016011906Z20.620171017954772357XHVDRXP011916DOEJANEX2016011906Z20.620171017954772357XHV
3D173616018DOEJUDEL2015032706Z2120170403953854210XHVD173616018DOEJUDEL2015032706Z2120170403953854210XHV
4DAEO110613DOEJILLE2013110606B2020150922952860686XHVDAEO110613DOEJILLE2013110606B2020150922952860686XHV
Sheet65
Cell Formulas
RangeFormula
M1=A1&B1&C1
N1=D1
O1=E1&F1&G1&H1
P1=I1
Q1=J1&K1
 
Upvote 0
What do you see in the formula bar when you select G1, do you see 6 or 06 ?
If the Actual value in G is only 6, formatted to show as 06, then do this:


Book1
ABCDEFGHIJKLMNOPQ
6DDXH110817DOEJOHNX201711086Z20.620171213958577066XHVDDXH110817DOEJOHNX2017110806Z20.620171213958577066XHV
7DRXP011916DOEJANEX201601196Z20.620171017954772357XHVDRXP011916DOEJANEX2016011906Z20.620171017954772357XHV
8D173616018DOEJUDEL201503276Z2120170403953854210XHVD173616018DOEJUDEL2015032706Z2120170403953854210XHV
9DAEO110613DOEJILLE201311066B2020150922952860686XHVDAEO110613DOEJILLE2013110606B2020150922952860686XHV
Sheet65
Cell Formulas
RangeFormula
M6=A6&B6&C6
N6=D6
O6=E6&F6&TEXT(G6,"00")&H6
P6=I6
Q6=J6&K6
 
Upvote 0
When I select format cell and select Text, it changes 06, to 6....
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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