+ Reply to Thread
Results 1 to 5 of 5

Formula to remove spaces between numbers?

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    Isle of Man
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    82

    Formula to remove spaces between numbers?

    I have a long list of numbers but I'll use the below as an example:

    In A1, I am starting with: 5 185%. I want this to end up as 5185.
    In A2 I have the formula: =SUBSTITUTE(A1, " %", "") - This is removing the percentage sign.
    In A3, I have the formula: =SUBSTITUTE(A2, " ", "") - this isn't removing the space for some reason? I can't even get this to work if I paste A2 over the top of itself as special values, it just won't remove the space.

    Am I doing something wrong? I have to do this for a lot of numbers..

    Thank you for any help! <3

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

    Re: Formula to remove spaces between numbers?

    If the source of the "numbers" is a website, the "space" is probably an HTML non-breaking space (ASCII character 0160).
    With source text in A1
    this formula removes the NBSP and the percent sign
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    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: Formula to remove spaces between numbers?

    Maybe this

    =SUBSTITUTE(SUBSTITUTE(A1," ",""),"%","")

    Row\Col
    A
    B
    1
    5 185%
    5185
    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

  4. #4
    Registered User
    Join Date
    11-25-2014
    Location
    Isle of Man
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    82

    Re: Formula to remove spaces between numbers?

    ^ Thanks for the above suggestions, it's much appreciated!

    The =SUBSTITUTE(SUBSTITUTE(A1,CHAR(160),""),"%","") code seemed to work!
    Thank you so much :D

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

    Re: Formula to remove spaces between numbers?

    Glad you got something you can use!

+ 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. Formula to Remove Spaces
    By manny19754 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-16-2014, 11:49 PM
  2. [SOLVED] Remove spaces in pasted numbers
    By Jonathan9 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-14-2014, 01:15 PM
  3. [SOLVED] remove spaces (special characters) after numbers
    By fareastwarriors in forum Excel General
    Replies: 13
    Last Post: 11-04-2012, 09:25 PM
  4. [SOLVED] Excel 2007 : Function to remove spaces in telephone numbers
    By benoj2005 in forum Excel General
    Replies: 6
    Last Post: 06-27-2012, 06:16 AM
  5. Replies: 3
    Last Post: 04-05-2012, 01:20 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