#1   Report Post  
Rhall
 
Posts: n/a
Default Spaces in Data


Hi,
I am trying to do a mail merge and the excel data that I am using has a
bunch of spaces in the field that shows the city. So when I list the
City St and Zip the state is about 7 spaces after the city like this.
123 Main Street

Anywhere usa 49000

Any ideas?

Thanks
RRH


--
Rhall
------------------------------------------------------------------------
Rhall's Profile: http://www.excelforum.com/member.php...o&userid=25630
View this thread: http://www.excelforum.com/showthread...hreadid=390428

  #2   Report Post  
Bryan Hessey
 
Posts: n/a
Default


I guess the space removal feature made that question fall flat.

If you wish to remove the spaces from your data, use =trim(A1) or
=trim(A1&" "&A2&" "&A3)

If you wanted to insert more spaces, then
=A1&" "&A3
should help


--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=390428

  #3   Report Post  
Rhall
 
Posts: n/a
Default


So do you mean to format the whole column with
=trim(g1)

Sorry, I don't know much about this yet.
Ramona


--
Rhall
------------------------------------------------------------------------
Rhall's Profile: http://www.excelforum.com/member.php...o&userid=25630
View this thread: http://www.excelforum.com/showthread...hreadid=390428

  #4   Report Post  
Mangus Pyke
 
Posts: n/a
Default

On Tue, 26 Jul 2005 20:59:13 -0500, Rhall wrote:
I am trying to do a mail merge and the excel data that I am using has a
bunch of spaces in the field that shows the city. So when I list the
City St and Zip the state is about 7 spaces after the city like this.
123 Main Street

Anywhere usa 49000



Solution 1:
Select the column, Edit -- Replace, put a space in the top field and
replace all (replaces the spaces with nothing). This will cause a
problem if you have a two-word city, such as Boca Raton.

Solution 2:
Suppose your city is in column C with a header row. Insert a column
after and put this in D2:
=TRIM(C2)

This will trim the white space from the end of the city name. Drag
the forumla down, select column D, press Edit -- Copy, Edit -- Paste
Special, select Value, click OK.

Problem resolved.

MP-
--
"Learning is a behavior that results from consequences."
B.F. Skinner
  #5   Report Post  
Bryan Hessey
 
Posts: n/a
Default


If your required data is in column G, then you would need to use a new
column (perhaps insert a new column H and push the other columns
over),
then in H1 put
=trim(G1)
and click on cell H1 and drag the small plus sign in the bottom right
corner of the highlight down the column for as many rows as you have
data in the G column.

This would then give a 'trimmed' column H for you to use.


--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=390428



  #6   Report Post  
Rhall
 
Posts: n/a
Default


Got it :) I had to highlight the whole column and copy it opened a
new workbook and pasted it in hit ctrl F to the find hit the space bar
three times and clicked into the replace with and hit the ok button.
Then I put the data back into the original workbook and did the mail
merge again.
So I guess it was that the field had extra spaces when the data was
created.
Thanks to all that sent me a reply and I look forward to learning more
on this site.
You guys are awesome!
Ramona


--
Rhall
------------------------------------------------------------------------
Rhall's Profile: http://www.excelforum.com/member.php...o&userid=25630
View this thread: http://www.excelforum.com/showthread...hreadid=390428

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compare 2 sets of data and highlight differences? Perplexed1 Excel Worksheet Functions 1 July 9th 05 01:15 AM
How do I import formmail data to a custom excel template? cxlough41 Excel Worksheet Functions 1 July 1st 05 12:59 AM
Data Source Name Not Found Justin Tyme Excel Worksheet Functions 0 June 16th 05 11:45 PM
Line Graph Data Recognition Nat Charts and Charting in Excel 2 April 30th 05 02:07 PM
Fetching External Data from Excel Sri Excel Discussion (Misc queries) 2 January 3rd 05 11:46 AM


All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"