+ Reply to Thread
Results 1 to 9 of 9

remove empty spaces in data

  1. #1
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    remove empty spaces in data

    I have a 1500-row database. I'd like to left-justify all the numbers but there are uneven spaces preceeding groups of numbers. What to do?
    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: remove empty spaces in data

    select column
    data text to columns fixed width
    click next,
    double click any break lines to remove them click next
    if you need to preserve leading zeros change field to text if not leave as general
    click finish
    alternatively use find replace
    find a single space replace with nothing
    Last edited by martindwilson; 02-11-2013 at 07:12 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: remove empty spaces in data

    Hmmm...I thought of this but the leading spaces are all over the place. No code will help?


    OK, tried it it worked. Thank you.
    Last edited by kisboros; 02-11-2013 at 07:30 PM.

  4. #4
    Registered User
    Join Date
    02-08-2013
    Location
    Louisiana, USA
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: remove empty spaces in data

    The trim function is a great function for this.

    =Trim(a1)

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: remove empty spaces in data

    try =TRIM(A1) copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    12-26-2012
    Location
    Meerut
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: remove empty spaces in data

    In C1

    =A1+0

  7. #7
    Forum Contributor visha_1984's Avatar
    Join Date
    11-27-2012
    Location
    Pune,India
    MS-Off Ver
    Excel 2010
    Posts
    290

    Re: remove empty spaces in data

    try in B1

    Please Login or Register  to view this content.
    and drag down
    Happy to Help

    VISHA

    Click *, if the suggestion helps you!
    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>> "Mark your thread as Solved"

  8. #8
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: remove empty spaces in data

    Hi kisboros

    Select the data in column A >> Data Tab >> Text to Columns >> Delimited >> Ensure everything is unticked >> Finish. Then Home Tab >> Editing >> Clear >> Clear Formats.

    This worked for the file that you uploaded!
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  9. #9
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: remove empty spaces in data

    Quote Originally Posted by bstier View Post
    The trim function is a great function for this.

    =Trim(a1)
    Thank you; I'll try this too.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1