+ Reply to Thread
Results 1 to 10 of 10

Excel 2007 : trim formula not working

Hybrid View

jfs trim formula not working 05-10-2011, 10:34 AM
NBVC Re: trim formula not working 05-10-2011, 10:49 AM
jfs Re: trim formula not working 05-10-2011, 11:02 AM
NBVC Re: trim formula not working 05-10-2011, 11:05 AM
jfs Re: trim formula not working 05-10-2011, 11:07 AM
NBVC Re: trim formula not working 05-10-2011, 11:11 AM
jfs Re: trim formula not working 05-10-2011, 11:16 AM
NBVC Re: trim formula not working 05-10-2011, 11:31 AM
jfs Re: trim formula not working 05-10-2011, 11:33 AM
NBVC Re: trim formula not working 05-10-2011, 11:46 AM
  1. #1
    Registered User
    Join Date
    02-09-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    34

    trim formula not working

    I am trying to use a trim formula to remove spaces that appear at the end of my numbers after copying from another report but the space is still there? Is it because I'm trying to trim a number? Everything is set to General - I even tried formatting to Text - but nothing is wokring. Please help...

    Trying to trim "34.54 " to "34.54"

    Thanks!
    Last edited by jfs; 05-10-2011 at 11:47 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: trim formula not working

    Perhaps that is another character at the end...

    try the CLEAN() function... and add 0 to convert to a real number...... e.g. =CLEAN(A1)+0

    if not working then...

    What does this formula yield? =Right(A1) where A1 is the cell containing the original value to trim.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    02-09-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: trim formula not working

    I tried the clean and it doesn't work. When I have the +0 I get the same #VALUE error. When I did the RIGHT formula, it showed up blank?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: trim formula not working

    Sorry, I meant:

    =Code(Right(A1))

  5. #5
    Registered User
    Join Date
    02-09-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: trim formula not working

    The original cell reads "25 ", and when I entered that formula it now says 160?

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: trim formula not working

    Okay,

    Try:

    =SUBSTITUTE(A1,CHAR(160),"")+0

    where A1 contains original.

  7. #7
    Registered User
    Join Date
    02-09-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: trim formula not working

    It worked! My cell says 25 and has no space!

    Ok, so obviously that's only one cell; I have a spreadsheet with probably 2000 numbers that need to be formatted the same way ... Do I have to do the CODE formula first and then do this one to get the right values to show up? And if so, can I replace the 160 in the second formula with a cell number?

    Sorry for the 20 questions, I just don't know the formulas you used to heroically solve my problem.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: trim formula not working

    If you want to replace the character in the cells in situ... then you can avoid formulas and use Edit|Replace.

    Select the range to fix and do a CTRL+H, then in Find What box, hold the ALT key down and type 0160 using only the number pad of your keyboard. Leave the Replace with field blank and then click Replace All.

    That should fix them all at once.

    If you want the formula, then you only need to use the SUBSTITUTE formula if the cells are adjacent to each other, you can copy the formula down the column or across the row... and the A1 will adjust itself relatively.

  9. #9
    Registered User
    Join Date
    02-09-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: trim formula not working

    I just used the replace to fix them all, you are fabulous!

    Thanks for everything!

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: trim formula not working

    Great, you are welcome.

    Please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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