+ Reply to Thread
Results 1 to 10 of 10

Trim Function not Working in Excel 2013

  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    rochester, ny
    MS-Off Ver
    Excel 2010
    Posts
    4

    Trim Function not Working in Excel 2013

    I have about 400k cells in a single column that have trailing spaces at the end, which is causing my VLOOKUP not to work. I am trying to remove the extra spaces using the TRIM function. However when I do this, nothing happens. The cell just remains looking like =TRIM(A2) with no corrected data in it. What am I doing wrong?

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Trim Function not Working in Excel 2013

    Try this formula

    =SUBSTITUTE(A2,CHAR(160),"")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Trim Function not Working in Excel 2013

    Change the format of the cell in which the formula appears to something OTHER than Text or General, e.g., Number
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Trim Function not Working in Excel 2013

    Quote Originally Posted by shg View Post
    Change the format of the cell in which the formula appears to something OTHER than Text or General, e.g., Number
    AND, RE-Enter the formula.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trim Function not Working in Excel 2013

    Instead of using 400k formulas to get rid of that character try running the macro at this link:

    http://www.mvps.org/dmcritchie/excel/join.htm#trimall
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Trim Function not Working in Excel 2013

    I suspect that the trailing "space" is actually an HTML-non-breaking-space.
    Try this on one of the cells...
    Example:
    =CODE(RIGHT(A1,1))

    If it returns 160...it's an HTML NBSP

    You might need to use something like this:
    Please Login or Register  to view this content.
    Alternatively, you might try Find/Replace
    • Select the range
    • Home.Find&Select.Replace
    ...Find what: Hold down ALT...Type: 0160 (on the number keypad)...Release ALT
    ...Replace with: (leave this blank)
    ...Click: Replace all


    Is that something you can work with?
    Last edited by Ron Coderre; 07-28-2015 at 12:47 PM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  7. #7
    Registered User
    Join Date
    04-03-2013
    Location
    rochester, ny
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Trim Function not Working in Excel 2013

    This did the trick. Thank you!

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Trim Function not Working in Excel 2013

    We'll never know ...

  9. #9
    Registered User
    Join Date
    01-08-2016
    Location
    Dublin, CA, USA
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: Trim Function not Working in Excel 2013

    shg - we will never know which one SHE used that worked, BUT changed the type from text to date (even though it only contained text) and then retyping in the formula worked for me.

  10. #10
    Registered User
    Join Date
    02-20-2017
    Location
    Missouri
    MS-Off Ver
    2013 64-Bit
    Posts
    2

    Re: Trim Function not Working in Excel 2013

    I had the NBSP issue. The item was originally in Word and I pasted it in Excel. Ron's advice was spot on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Why does the trim() function not working? This is so bizarre!
    By tjj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-05-2016, 10:26 AM
  2. [SOLVED] Trim Function not working in Worksheet Search box
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-11-2014, 09:09 PM
  3. Trim Function not working...help!
    By Taycore in forum Excel General
    Replies: 1
    Last Post: 05-13-2012, 02:22 AM
  4. Trim Function not working...help!
    By Taycore in forum Excel General
    Replies: 2
    Last Post: 05-12-2012, 05:37 AM
  5. Multiple Trim Function not working
    By marc5354 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2010, 06:27 PM
  6. Trim Function not working
    By karinos57 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-16-2009, 06:13 PM
  7. Trying to trim a trailing space char and the Trim function isn't working
    By Psychochook in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2007, 11:28 PM

Tags for this Thread

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