How to remove white space from a number











up vote
13
down vote

favorite
2












I have a column of number with white spaces in them. Like this: "32 445 423". How do I get rid of all the white space to get excel to treat it as numbers rather than strings?



EDIT: Let me fill in some additional information that has come to light. My goal is to turn "32 445 423" into a 32445423. If I write in the string "32 445 423" into excel and use =SUBSTITUTE(A1;" ";"") it removes the spaces just fine. But the numbers I have are imported from a csv file. When running SUBSTITUTE on the imported numbers only leading and trailing spaces are removed.










share|improve this question




















  • 1




    hey, do you want to split that string in 3 numbers or just to threat this as one number (in that case, " " is like a number separator of each x1000)?
    – kokbira
    Jul 8 '11 at 13:19

















up vote
13
down vote

favorite
2












I have a column of number with white spaces in them. Like this: "32 445 423". How do I get rid of all the white space to get excel to treat it as numbers rather than strings?



EDIT: Let me fill in some additional information that has come to light. My goal is to turn "32 445 423" into a 32445423. If I write in the string "32 445 423" into excel and use =SUBSTITUTE(A1;" ";"") it removes the spaces just fine. But the numbers I have are imported from a csv file. When running SUBSTITUTE on the imported numbers only leading and trailing spaces are removed.










share|improve this question




















  • 1




    hey, do you want to split that string in 3 numbers or just to threat this as one number (in that case, " " is like a number separator of each x1000)?
    – kokbira
    Jul 8 '11 at 13:19















up vote
13
down vote

favorite
2









up vote
13
down vote

favorite
2






2





I have a column of number with white spaces in them. Like this: "32 445 423". How do I get rid of all the white space to get excel to treat it as numbers rather than strings?



EDIT: Let me fill in some additional information that has come to light. My goal is to turn "32 445 423" into a 32445423. If I write in the string "32 445 423" into excel and use =SUBSTITUTE(A1;" ";"") it removes the spaces just fine. But the numbers I have are imported from a csv file. When running SUBSTITUTE on the imported numbers only leading and trailing spaces are removed.










share|improve this question















I have a column of number with white spaces in them. Like this: "32 445 423". How do I get rid of all the white space to get excel to treat it as numbers rather than strings?



EDIT: Let me fill in some additional information that has come to light. My goal is to turn "32 445 423" into a 32445423. If I write in the string "32 445 423" into excel and use =SUBSTITUTE(A1;" ";"") it removes the spaces just fine. But the numbers I have are imported from a csv file. When running SUBSTITUTE on the imported numbers only leading and trailing spaces are removed.







microsoft-excel microsoft-excel-2007






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 29 '13 at 16:09









TFM

4,17822637




4,17822637










asked Jul 8 '11 at 11:40









Mr Alpha

6,20621825




6,20621825








  • 1




    hey, do you want to split that string in 3 numbers or just to threat this as one number (in that case, " " is like a number separator of each x1000)?
    – kokbira
    Jul 8 '11 at 13:19
















  • 1




    hey, do you want to split that string in 3 numbers or just to threat this as one number (in that case, " " is like a number separator of each x1000)?
    – kokbira
    Jul 8 '11 at 13:19










1




1




hey, do you want to split that string in 3 numbers or just to threat this as one number (in that case, " " is like a number separator of each x1000)?
– kokbira
Jul 8 '11 at 13:19






hey, do you want to split that string in 3 numbers or just to threat this as one number (in that case, " " is like a number separator of each x1000)?
– kokbira
Jul 8 '11 at 13:19












11 Answers
11






active

oldest

votes

















up vote
9
down vote



accepted










I believe your imported data includes non-breaking spaces instead of standard spaces. Hence, the formula =SUBSTITUTE(A1," ","") does not work. Instead of using the space bar to type the " " in the SUBSTITUTE formula, try a non-breaking space. You can select this in the Character Map or use keystroke Alt+0160.



EDIT:



Since substituting regular spaces successfully removed the leading and trailing spaces, you should use nested Substitute formulas: one to sub the regular spaces and one to remove the no-break spaces.



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


You can copy this formula to try it in your workbook.






share|improve this answer



















  • 3




    +1 for considering non-breaking spaces. As an option, I also suggest using CHAR(160) to represent non-breaking spaces in your formula.
    – Ellesa
    Jul 9 '11 at 4:52












  • You were correct. The spaces in between the numbers were non-breaking spaces. With your substitute I was able to remove them.
    – Mr Alpha
    Jul 10 '11 at 11:34






  • 1




    he could simply copy the space in between and using it to match that whitespace
    – user8228
    Jul 10 '11 at 11:48


















up vote
6
down vote













Just do a search and replace over a group of cells you have selected, select your column and go to Home and Find and Select. Search for a space, and replace it with nothing.






share|improve this answer

















  • 1




    if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
    – kokbira
    Jul 8 '11 at 13:17












  • @kokbira He does not explicitly ask to split the numbers, as I interpreted "treat it as numbers" as meaning each cell would be a number. I can see where you are coming from in your interpretation, and that may very well be what he needs.
    – jonsca
    Jul 8 '11 at 13:21


















up vote
6
down vote













Alternately if you want to retain the originally formatted number you can use the substitute function to provide a revised version of the string in another cell:



=SUBSTITUTE(A2," ","")





share|improve this answer





















  • Oh sure, go the "high-tech" route :) Just kidding, nice one.
    – jonsca
    Jul 8 '11 at 12:16










  • This only removed the leading and trailing spaces, not the spaces in between the numbers.
    – Mr Alpha
    Jul 8 '11 at 12:34






  • 1




    I did test it before posting and it correctly replaced all spaces. So I am not sure why it's not working for you.
    – Jane T
    Jul 8 '11 at 13:08










  • if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
    – kokbira
    Jul 8 '11 at 13:16








  • 2




    Weird. Usually, the formula above should work even with strings imported from a CSV. Try any of these and see if they work: =SUBSTITUTE(CLEAN(A2)), " ", "") or =SUBSTITUTE(A2,CHAR(160),"")
    – Ellesa
    Jul 9 '11 at 4:39




















up vote
2
down vote













It sounds like you want to extract the numbers and put them in to separate columns. You can use the "Text to Columns" command, which is located on the Data tab (in Excel 2007). This walks you through a series of dialog boxes letting you specify how the fields are delimited and how you want the numbers formatted.






share|improve this answer





















  • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
    – kokbira
    Jul 8 '11 at 13:21


















up vote
2
down vote













This solution is to split 1 string with 3 numbers separated by spaces in 3 other numbers.



For didactic Purposes, let's consider:



     |    A    |    B    |    C    |    D    |    E    |
_____|_________|_________|_________|_________|_________|
| | | | | |
1 |123 45 67| | | | |
_____|_________|_________|_________|_________|_________|
| | | | | |
2 | | | | | |
_____|_________|_________|_________|_________|_________|
| | | | | |
3 | | | | | |
_____|_________|_________|_________|_________|_________|
| | | | | |
4 | | | | | |
_____|_________|_________|_________|_________|_________|


So we can do that to help with next formulas:



For B1, where we start our search in A1 string - first character: =1
For C1, where is the first space in A1: =SEARCH(" ";A1;B1)
For D1, where is the second space in A1: =SEARCH(" ";A1;C1)
For E1, the length of string in A1: =LEN(A1)


And then what do you want:



For B2, to get first number: =SUBSTITUTE(A1;C1;C3-C1+1;"")
For C2, to get second number: =EXTRACT(A1;C1+1;D1-C1-1)
For D2, to get third number: =SUBSTITUTE(A1;B1;C2;"")


If you want, you can eliminate auxiliar formulas in B1:E1 including their contents in formulas in B2:D2






share|improve this answer























  • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
    – kokbira
    Jul 8 '11 at 13:21


















up vote
0
down vote













I had the same problem, a space occured as soon as my data had a 1000 plus value (so all numbers 1000+ looked like 3 333,00.
I discovered that it was indeed the ALT+0160 character (I discoverd this by copying and pasting it word.



Quick fix to remove this "invisble char" is the following:




  1. Select a cell where the space occurs

  2. Select and copy ONLY the "space"

  3. Select entire worksheet (Ctrl +A)

  4. Start the find function (Ctrl + F)

  5. Go to the "replace" tab.

  6. "Find what" -> Paste your "space", "Replace with" -> Leave empty

  7. Select "Replace all"


Now all your data should be without spaces, and excel should see all data as Numbers.






share|improve this answer






























    up vote
    0
    down vote













    Quick to remove the "invisible char" at the "blank cell" in Worksheet as follows.




    1. Select a blank cell where the space occurs

    2. Copy the blank cell (Ctrl + C)

    3. Start the find function (Ctrl + F)

    4. Go to the "replace" tab.

    5. "Find what" -> Paste your "space", "Replace with" -> Leave empty

    6. Click "Option"

    7. Tick "Match entire cell contents"

    8. Select "Replace all"


    P.S. The useful information is without affected.






    share|improve this answer




























      up vote
      0
      down vote













      just copy your data into a .txt file and open the .txt file with excel, this will separate each column correctly into the worksheet...






      share|improve this answer




























        up vote
        0
        down vote













        Just use the text to column feature in data group .. and split your data using ""space"" option use ""concatenate"" to combine these number without spaces.



        For Example:




        32 445 423




        use "text to column"

        it will return




        32|445|423




        use concatenate formula, that will return your required format 32445423






        share|improve this answer























        • Welcome to Super User! Don't use all caps in your posts. No one wants to be screamed at.
          – Excellll
          Mar 14 '16 at 14:57


















        up vote
        0
        down vote













        Sometimes a space in excel, are not a spaces, try to copy that "space" and pasted in replace dialog instead " ".






        share|improve this answer

















        • 2




          What do you mean by "a space is not a space"?
          – Toto
          Sep 20 '17 at 10:36


















        up vote
        0
        down vote













        Try this -



        =VALUE(SUBSTITUTE(A2,CHAR(160),""))






        share|improve this answer





















        • I believe that this works even without  VALUE().
          – Scott
          Nov 30 at 18:51











        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "3"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f308072%2fhow-to-remove-white-space-from-a-number%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        11 Answers
        11






        active

        oldest

        votes








        11 Answers
        11






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        9
        down vote



        accepted










        I believe your imported data includes non-breaking spaces instead of standard spaces. Hence, the formula =SUBSTITUTE(A1," ","") does not work. Instead of using the space bar to type the " " in the SUBSTITUTE formula, try a non-breaking space. You can select this in the Character Map or use keystroke Alt+0160.



        EDIT:



        Since substituting regular spaces successfully removed the leading and trailing spaces, you should use nested Substitute formulas: one to sub the regular spaces and one to remove the no-break spaces.



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


        You can copy this formula to try it in your workbook.






        share|improve this answer



















        • 3




          +1 for considering non-breaking spaces. As an option, I also suggest using CHAR(160) to represent non-breaking spaces in your formula.
          – Ellesa
          Jul 9 '11 at 4:52












        • You were correct. The spaces in between the numbers were non-breaking spaces. With your substitute I was able to remove them.
          – Mr Alpha
          Jul 10 '11 at 11:34






        • 1




          he could simply copy the space in between and using it to match that whitespace
          – user8228
          Jul 10 '11 at 11:48















        up vote
        9
        down vote



        accepted










        I believe your imported data includes non-breaking spaces instead of standard spaces. Hence, the formula =SUBSTITUTE(A1," ","") does not work. Instead of using the space bar to type the " " in the SUBSTITUTE formula, try a non-breaking space. You can select this in the Character Map or use keystroke Alt+0160.



        EDIT:



        Since substituting regular spaces successfully removed the leading and trailing spaces, you should use nested Substitute formulas: one to sub the regular spaces and one to remove the no-break spaces.



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


        You can copy this formula to try it in your workbook.






        share|improve this answer



















        • 3




          +1 for considering non-breaking spaces. As an option, I also suggest using CHAR(160) to represent non-breaking spaces in your formula.
          – Ellesa
          Jul 9 '11 at 4:52












        • You were correct. The spaces in between the numbers were non-breaking spaces. With your substitute I was able to remove them.
          – Mr Alpha
          Jul 10 '11 at 11:34






        • 1




          he could simply copy the space in between and using it to match that whitespace
          – user8228
          Jul 10 '11 at 11:48













        up vote
        9
        down vote



        accepted







        up vote
        9
        down vote



        accepted






        I believe your imported data includes non-breaking spaces instead of standard spaces. Hence, the formula =SUBSTITUTE(A1," ","") does not work. Instead of using the space bar to type the " " in the SUBSTITUTE formula, try a non-breaking space. You can select this in the Character Map or use keystroke Alt+0160.



        EDIT:



        Since substituting regular spaces successfully removed the leading and trailing spaces, you should use nested Substitute formulas: one to sub the regular spaces and one to remove the no-break spaces.



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


        You can copy this formula to try it in your workbook.






        share|improve this answer














        I believe your imported data includes non-breaking spaces instead of standard spaces. Hence, the formula =SUBSTITUTE(A1," ","") does not work. Instead of using the space bar to type the " " in the SUBSTITUTE formula, try a non-breaking space. You can select this in the Character Map or use keystroke Alt+0160.



        EDIT:



        Since substituting regular spaces successfully removed the leading and trailing spaces, you should use nested Substitute formulas: one to sub the regular spaces and one to remove the no-break spaces.



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


        You can copy this formula to try it in your workbook.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 8 '11 at 14:12

























        answered Jul 8 '11 at 13:47









        Excellll

        11k74162




        11k74162








        • 3




          +1 for considering non-breaking spaces. As an option, I also suggest using CHAR(160) to represent non-breaking spaces in your formula.
          – Ellesa
          Jul 9 '11 at 4:52












        • You were correct. The spaces in between the numbers were non-breaking spaces. With your substitute I was able to remove them.
          – Mr Alpha
          Jul 10 '11 at 11:34






        • 1




          he could simply copy the space in between and using it to match that whitespace
          – user8228
          Jul 10 '11 at 11:48














        • 3




          +1 for considering non-breaking spaces. As an option, I also suggest using CHAR(160) to represent non-breaking spaces in your formula.
          – Ellesa
          Jul 9 '11 at 4:52












        • You were correct. The spaces in between the numbers were non-breaking spaces. With your substitute I was able to remove them.
          – Mr Alpha
          Jul 10 '11 at 11:34






        • 1




          he could simply copy the space in between and using it to match that whitespace
          – user8228
          Jul 10 '11 at 11:48








        3




        3




        +1 for considering non-breaking spaces. As an option, I also suggest using CHAR(160) to represent non-breaking spaces in your formula.
        – Ellesa
        Jul 9 '11 at 4:52






        +1 for considering non-breaking spaces. As an option, I also suggest using CHAR(160) to represent non-breaking spaces in your formula.
        – Ellesa
        Jul 9 '11 at 4:52














        You were correct. The spaces in between the numbers were non-breaking spaces. With your substitute I was able to remove them.
        – Mr Alpha
        Jul 10 '11 at 11:34




        You were correct. The spaces in between the numbers were non-breaking spaces. With your substitute I was able to remove them.
        – Mr Alpha
        Jul 10 '11 at 11:34




        1




        1




        he could simply copy the space in between and using it to match that whitespace
        – user8228
        Jul 10 '11 at 11:48




        he could simply copy the space in between and using it to match that whitespace
        – user8228
        Jul 10 '11 at 11:48












        up vote
        6
        down vote













        Just do a search and replace over a group of cells you have selected, select your column and go to Home and Find and Select. Search for a space, and replace it with nothing.






        share|improve this answer

















        • 1




          if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:17












        • @kokbira He does not explicitly ask to split the numbers, as I interpreted "treat it as numbers" as meaning each cell would be a number. I can see where you are coming from in your interpretation, and that may very well be what he needs.
          – jonsca
          Jul 8 '11 at 13:21















        up vote
        6
        down vote













        Just do a search and replace over a group of cells you have selected, select your column and go to Home and Find and Select. Search for a space, and replace it with nothing.






        share|improve this answer

















        • 1




          if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:17












        • @kokbira He does not explicitly ask to split the numbers, as I interpreted "treat it as numbers" as meaning each cell would be a number. I can see where you are coming from in your interpretation, and that may very well be what he needs.
          – jonsca
          Jul 8 '11 at 13:21













        up vote
        6
        down vote










        up vote
        6
        down vote









        Just do a search and replace over a group of cells you have selected, select your column and go to Home and Find and Select. Search for a space, and replace it with nothing.






        share|improve this answer












        Just do a search and replace over a group of cells you have selected, select your column and go to Home and Find and Select. Search for a space, and replace it with nothing.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 8 '11 at 11:55









        jonsca

        2,897112539




        2,897112539








        • 1




          if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:17












        • @kokbira He does not explicitly ask to split the numbers, as I interpreted "treat it as numbers" as meaning each cell would be a number. I can see where you are coming from in your interpretation, and that may very well be what he needs.
          – jonsca
          Jul 8 '11 at 13:21














        • 1




          if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:17












        • @kokbira He does not explicitly ask to split the numbers, as I interpreted "treat it as numbers" as meaning each cell would be a number. I can see where you are coming from in your interpretation, and that may very well be what he needs.
          – jonsca
          Jul 8 '11 at 13:21








        1




        1




        if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
        – kokbira
        Jul 8 '11 at 13:17






        if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
        – kokbira
        Jul 8 '11 at 13:17














        @kokbira He does not explicitly ask to split the numbers, as I interpreted "treat it as numbers" as meaning each cell would be a number. I can see where you are coming from in your interpretation, and that may very well be what he needs.
        – jonsca
        Jul 8 '11 at 13:21




        @kokbira He does not explicitly ask to split the numbers, as I interpreted "treat it as numbers" as meaning each cell would be a number. I can see where you are coming from in your interpretation, and that may very well be what he needs.
        – jonsca
        Jul 8 '11 at 13:21










        up vote
        6
        down vote













        Alternately if you want to retain the originally formatted number you can use the substitute function to provide a revised version of the string in another cell:



        =SUBSTITUTE(A2," ","")





        share|improve this answer





















        • Oh sure, go the "high-tech" route :) Just kidding, nice one.
          – jonsca
          Jul 8 '11 at 12:16










        • This only removed the leading and trailing spaces, not the spaces in between the numbers.
          – Mr Alpha
          Jul 8 '11 at 12:34






        • 1




          I did test it before posting and it correctly replaced all spaces. So I am not sure why it's not working for you.
          – Jane T
          Jul 8 '11 at 13:08










        • if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:16








        • 2




          Weird. Usually, the formula above should work even with strings imported from a CSV. Try any of these and see if they work: =SUBSTITUTE(CLEAN(A2)), " ", "") or =SUBSTITUTE(A2,CHAR(160),"")
          – Ellesa
          Jul 9 '11 at 4:39

















        up vote
        6
        down vote













        Alternately if you want to retain the originally formatted number you can use the substitute function to provide a revised version of the string in another cell:



        =SUBSTITUTE(A2," ","")





        share|improve this answer





















        • Oh sure, go the "high-tech" route :) Just kidding, nice one.
          – jonsca
          Jul 8 '11 at 12:16










        • This only removed the leading and trailing spaces, not the spaces in between the numbers.
          – Mr Alpha
          Jul 8 '11 at 12:34






        • 1




          I did test it before posting and it correctly replaced all spaces. So I am not sure why it's not working for you.
          – Jane T
          Jul 8 '11 at 13:08










        • if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:16








        • 2




          Weird. Usually, the formula above should work even with strings imported from a CSV. Try any of these and see if they work: =SUBSTITUTE(CLEAN(A2)), " ", "") or =SUBSTITUTE(A2,CHAR(160),"")
          – Ellesa
          Jul 9 '11 at 4:39















        up vote
        6
        down vote










        up vote
        6
        down vote









        Alternately if you want to retain the originally formatted number you can use the substitute function to provide a revised version of the string in another cell:



        =SUBSTITUTE(A2," ","")





        share|improve this answer












        Alternately if you want to retain the originally formatted number you can use the substitute function to provide a revised version of the string in another cell:



        =SUBSTITUTE(A2," ","")






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 8 '11 at 12:08









        Jane T

        80558




        80558












        • Oh sure, go the "high-tech" route :) Just kidding, nice one.
          – jonsca
          Jul 8 '11 at 12:16










        • This only removed the leading and trailing spaces, not the spaces in between the numbers.
          – Mr Alpha
          Jul 8 '11 at 12:34






        • 1




          I did test it before posting and it correctly replaced all spaces. So I am not sure why it's not working for you.
          – Jane T
          Jul 8 '11 at 13:08










        • if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:16








        • 2




          Weird. Usually, the formula above should work even with strings imported from a CSV. Try any of these and see if they work: =SUBSTITUTE(CLEAN(A2)), " ", "") or =SUBSTITUTE(A2,CHAR(160),"")
          – Ellesa
          Jul 9 '11 at 4:39




















        • Oh sure, go the "high-tech" route :) Just kidding, nice one.
          – jonsca
          Jul 8 '11 at 12:16










        • This only removed the leading and trailing spaces, not the spaces in between the numbers.
          – Mr Alpha
          Jul 8 '11 at 12:34






        • 1




          I did test it before posting and it correctly replaced all spaces. So I am not sure why it's not working for you.
          – Jane T
          Jul 8 '11 at 13:08










        • if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
          – kokbira
          Jul 8 '11 at 13:16








        • 2




          Weird. Usually, the formula above should work even with strings imported from a CSV. Try any of these and see if they work: =SUBSTITUTE(CLEAN(A2)), " ", "") or =SUBSTITUTE(A2,CHAR(160),"")
          – Ellesa
          Jul 9 '11 at 4:39


















        Oh sure, go the "high-tech" route :) Just kidding, nice one.
        – jonsca
        Jul 8 '11 at 12:16




        Oh sure, go the "high-tech" route :) Just kidding, nice one.
        – jonsca
        Jul 8 '11 at 12:16












        This only removed the leading and trailing spaces, not the spaces in between the numbers.
        – Mr Alpha
        Jul 8 '11 at 12:34




        This only removed the leading and trailing spaces, not the spaces in between the numbers.
        – Mr Alpha
        Jul 8 '11 at 12:34




        1




        1




        I did test it before posting and it correctly replaced all spaces. So I am not sure why it's not working for you.
        – Jane T
        Jul 8 '11 at 13:08




        I did test it before posting and it correctly replaced all spaces. So I am not sure why it's not working for you.
        – Jane T
        Jul 8 '11 at 13:08












        if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
        – kokbira
        Jul 8 '11 at 13:16






        if he wants to split the string in 3 numbers, it is not ok. but if he wants to threat that string as only one number, it is ok.
        – kokbira
        Jul 8 '11 at 13:16






        2




        2




        Weird. Usually, the formula above should work even with strings imported from a CSV. Try any of these and see if they work: =SUBSTITUTE(CLEAN(A2)), " ", "") or =SUBSTITUTE(A2,CHAR(160),"")
        – Ellesa
        Jul 9 '11 at 4:39






        Weird. Usually, the formula above should work even with strings imported from a CSV. Try any of these and see if they work: =SUBSTITUTE(CLEAN(A2)), " ", "") or =SUBSTITUTE(A2,CHAR(160),"")
        – Ellesa
        Jul 9 '11 at 4:39












        up vote
        2
        down vote













        It sounds like you want to extract the numbers and put them in to separate columns. You can use the "Text to Columns" command, which is located on the Data tab (in Excel 2007). This walks you through a series of dialog boxes letting you specify how the fields are delimited and how you want the numbers formatted.






        share|improve this answer





















        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21















        up vote
        2
        down vote













        It sounds like you want to extract the numbers and put them in to separate columns. You can use the "Text to Columns" command, which is located on the Data tab (in Excel 2007). This walks you through a series of dialog boxes letting you specify how the fields are delimited and how you want the numbers formatted.






        share|improve this answer





















        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21













        up vote
        2
        down vote










        up vote
        2
        down vote









        It sounds like you want to extract the numbers and put them in to separate columns. You can use the "Text to Columns" command, which is located on the Data tab (in Excel 2007). This walks you through a series of dialog boxes letting you specify how the fields are delimited and how you want the numbers formatted.






        share|improve this answer












        It sounds like you want to extract the numbers and put them in to separate columns. You can use the "Text to Columns" command, which is located on the Data tab (in Excel 2007). This walks you through a series of dialog boxes letting you specify how the fields are delimited and how you want the numbers formatted.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 8 '11 at 12:50









        erichui

        7841612




        7841612












        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21


















        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21
















        if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
        – kokbira
        Jul 8 '11 at 13:21




        if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
        – kokbira
        Jul 8 '11 at 13:21










        up vote
        2
        down vote













        This solution is to split 1 string with 3 numbers separated by spaces in 3 other numbers.



        For didactic Purposes, let's consider:



             |    A    |    B    |    C    |    D    |    E    |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        1 |123 45 67| | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        2 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        3 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        4 | | | | | |
        _____|_________|_________|_________|_________|_________|


        So we can do that to help with next formulas:



        For B1, where we start our search in A1 string - first character: =1
        For C1, where is the first space in A1: =SEARCH(" ";A1;B1)
        For D1, where is the second space in A1: =SEARCH(" ";A1;C1)
        For E1, the length of string in A1: =LEN(A1)


        And then what do you want:



        For B2, to get first number: =SUBSTITUTE(A1;C1;C3-C1+1;"")
        For C2, to get second number: =EXTRACT(A1;C1+1;D1-C1-1)
        For D2, to get third number: =SUBSTITUTE(A1;B1;C2;"")


        If you want, you can eliminate auxiliar formulas in B1:E1 including their contents in formulas in B2:D2






        share|improve this answer























        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21















        up vote
        2
        down vote













        This solution is to split 1 string with 3 numbers separated by spaces in 3 other numbers.



        For didactic Purposes, let's consider:



             |    A    |    B    |    C    |    D    |    E    |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        1 |123 45 67| | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        2 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        3 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        4 | | | | | |
        _____|_________|_________|_________|_________|_________|


        So we can do that to help with next formulas:



        For B1, where we start our search in A1 string - first character: =1
        For C1, where is the first space in A1: =SEARCH(" ";A1;B1)
        For D1, where is the second space in A1: =SEARCH(" ";A1;C1)
        For E1, the length of string in A1: =LEN(A1)


        And then what do you want:



        For B2, to get first number: =SUBSTITUTE(A1;C1;C3-C1+1;"")
        For C2, to get second number: =EXTRACT(A1;C1+1;D1-C1-1)
        For D2, to get third number: =SUBSTITUTE(A1;B1;C2;"")


        If you want, you can eliminate auxiliar formulas in B1:E1 including their contents in formulas in B2:D2






        share|improve this answer























        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21













        up vote
        2
        down vote










        up vote
        2
        down vote









        This solution is to split 1 string with 3 numbers separated by spaces in 3 other numbers.



        For didactic Purposes, let's consider:



             |    A    |    B    |    C    |    D    |    E    |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        1 |123 45 67| | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        2 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        3 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        4 | | | | | |
        _____|_________|_________|_________|_________|_________|


        So we can do that to help with next formulas:



        For B1, where we start our search in A1 string - first character: =1
        For C1, where is the first space in A1: =SEARCH(" ";A1;B1)
        For D1, where is the second space in A1: =SEARCH(" ";A1;C1)
        For E1, the length of string in A1: =LEN(A1)


        And then what do you want:



        For B2, to get first number: =SUBSTITUTE(A1;C1;C3-C1+1;"")
        For C2, to get second number: =EXTRACT(A1;C1+1;D1-C1-1)
        For D2, to get third number: =SUBSTITUTE(A1;B1;C2;"")


        If you want, you can eliminate auxiliar formulas in B1:E1 including their contents in formulas in B2:D2






        share|improve this answer














        This solution is to split 1 string with 3 numbers separated by spaces in 3 other numbers.



        For didactic Purposes, let's consider:



             |    A    |    B    |    C    |    D    |    E    |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        1 |123 45 67| | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        2 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        3 | | | | | |
        _____|_________|_________|_________|_________|_________|
        | | | | | |
        4 | | | | | |
        _____|_________|_________|_________|_________|_________|


        So we can do that to help with next formulas:



        For B1, where we start our search in A1 string - first character: =1
        For C1, where is the first space in A1: =SEARCH(" ";A1;B1)
        For D1, where is the second space in A1: =SEARCH(" ";A1;C1)
        For E1, the length of string in A1: =LEN(A1)


        And then what do you want:



        For B2, to get first number: =SUBSTITUTE(A1;C1;C3-C1+1;"")
        For C2, to get second number: =EXTRACT(A1;C1+1;D1-C1-1)
        For D2, to get third number: =SUBSTITUTE(A1;B1;C2;"")


        If you want, you can eliminate auxiliar formulas in B1:E1 including their contents in formulas in B2:D2







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 8 '11 at 13:26

























        answered Jul 8 '11 at 12:57









        kokbira

        4,078113465




        4,078113465












        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21


















        • if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
          – kokbira
          Jul 8 '11 at 13:21
















        if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
        – kokbira
        Jul 8 '11 at 13:21




        if he wants to split the string in 3 numbers, it is ok. but if he wants to threat that string as only one number, it is not ok.
        – kokbira
        Jul 8 '11 at 13:21










        up vote
        0
        down vote













        I had the same problem, a space occured as soon as my data had a 1000 plus value (so all numbers 1000+ looked like 3 333,00.
        I discovered that it was indeed the ALT+0160 character (I discoverd this by copying and pasting it word.



        Quick fix to remove this "invisble char" is the following:




        1. Select a cell where the space occurs

        2. Select and copy ONLY the "space"

        3. Select entire worksheet (Ctrl +A)

        4. Start the find function (Ctrl + F)

        5. Go to the "replace" tab.

        6. "Find what" -> Paste your "space", "Replace with" -> Leave empty

        7. Select "Replace all"


        Now all your data should be without spaces, and excel should see all data as Numbers.






        share|improve this answer



























          up vote
          0
          down vote













          I had the same problem, a space occured as soon as my data had a 1000 plus value (so all numbers 1000+ looked like 3 333,00.
          I discovered that it was indeed the ALT+0160 character (I discoverd this by copying and pasting it word.



          Quick fix to remove this "invisble char" is the following:




          1. Select a cell where the space occurs

          2. Select and copy ONLY the "space"

          3. Select entire worksheet (Ctrl +A)

          4. Start the find function (Ctrl + F)

          5. Go to the "replace" tab.

          6. "Find what" -> Paste your "space", "Replace with" -> Leave empty

          7. Select "Replace all"


          Now all your data should be without spaces, and excel should see all data as Numbers.






          share|improve this answer

























            up vote
            0
            down vote










            up vote
            0
            down vote









            I had the same problem, a space occured as soon as my data had a 1000 plus value (so all numbers 1000+ looked like 3 333,00.
            I discovered that it was indeed the ALT+0160 character (I discoverd this by copying and pasting it word.



            Quick fix to remove this "invisble char" is the following:




            1. Select a cell where the space occurs

            2. Select and copy ONLY the "space"

            3. Select entire worksheet (Ctrl +A)

            4. Start the find function (Ctrl + F)

            5. Go to the "replace" tab.

            6. "Find what" -> Paste your "space", "Replace with" -> Leave empty

            7. Select "Replace all"


            Now all your data should be without spaces, and excel should see all data as Numbers.






            share|improve this answer














            I had the same problem, a space occured as soon as my data had a 1000 plus value (so all numbers 1000+ looked like 3 333,00.
            I discovered that it was indeed the ALT+0160 character (I discoverd this by copying and pasting it word.



            Quick fix to remove this "invisble char" is the following:




            1. Select a cell where the space occurs

            2. Select and copy ONLY the "space"

            3. Select entire worksheet (Ctrl +A)

            4. Start the find function (Ctrl + F)

            5. Go to the "replace" tab.

            6. "Find what" -> Paste your "space", "Replace with" -> Leave empty

            7. Select "Replace all"


            Now all your data should be without spaces, and excel should see all data as Numbers.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 29 '13 at 16:00









            Doug Harris

            20.2k1463103




            20.2k1463103










            answered Mar 29 '13 at 15:31









            JayZ

            1




            1






















                up vote
                0
                down vote













                Quick to remove the "invisible char" at the "blank cell" in Worksheet as follows.




                1. Select a blank cell where the space occurs

                2. Copy the blank cell (Ctrl + C)

                3. Start the find function (Ctrl + F)

                4. Go to the "replace" tab.

                5. "Find what" -> Paste your "space", "Replace with" -> Leave empty

                6. Click "Option"

                7. Tick "Match entire cell contents"

                8. Select "Replace all"


                P.S. The useful information is without affected.






                share|improve this answer

























                  up vote
                  0
                  down vote













                  Quick to remove the "invisible char" at the "blank cell" in Worksheet as follows.




                  1. Select a blank cell where the space occurs

                  2. Copy the blank cell (Ctrl + C)

                  3. Start the find function (Ctrl + F)

                  4. Go to the "replace" tab.

                  5. "Find what" -> Paste your "space", "Replace with" -> Leave empty

                  6. Click "Option"

                  7. Tick "Match entire cell contents"

                  8. Select "Replace all"


                  P.S. The useful information is without affected.






                  share|improve this answer























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    Quick to remove the "invisible char" at the "blank cell" in Worksheet as follows.




                    1. Select a blank cell where the space occurs

                    2. Copy the blank cell (Ctrl + C)

                    3. Start the find function (Ctrl + F)

                    4. Go to the "replace" tab.

                    5. "Find what" -> Paste your "space", "Replace with" -> Leave empty

                    6. Click "Option"

                    7. Tick "Match entire cell contents"

                    8. Select "Replace all"


                    P.S. The useful information is without affected.






                    share|improve this answer












                    Quick to remove the "invisible char" at the "blank cell" in Worksheet as follows.




                    1. Select a blank cell where the space occurs

                    2. Copy the blank cell (Ctrl + C)

                    3. Start the find function (Ctrl + F)

                    4. Go to the "replace" tab.

                    5. "Find what" -> Paste your "space", "Replace with" -> Leave empty

                    6. Click "Option"

                    7. Tick "Match entire cell contents"

                    8. Select "Replace all"


                    P.S. The useful information is without affected.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Aug 24 '13 at 12:08









                    user248182

                    1




                    1






















                        up vote
                        0
                        down vote













                        just copy your data into a .txt file and open the .txt file with excel, this will separate each column correctly into the worksheet...






                        share|improve this answer

























                          up vote
                          0
                          down vote













                          just copy your data into a .txt file and open the .txt file with excel, this will separate each column correctly into the worksheet...






                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            just copy your data into a .txt file and open the .txt file with excel, this will separate each column correctly into the worksheet...






                            share|improve this answer












                            just copy your data into a .txt file and open the .txt file with excel, this will separate each column correctly into the worksheet...







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 11 '15 at 6:29









                            nicojl

                            11




                            11






















                                up vote
                                0
                                down vote













                                Just use the text to column feature in data group .. and split your data using ""space"" option use ""concatenate"" to combine these number without spaces.



                                For Example:




                                32 445 423




                                use "text to column"

                                it will return




                                32|445|423




                                use concatenate formula, that will return your required format 32445423






                                share|improve this answer























                                • Welcome to Super User! Don't use all caps in your posts. No one wants to be screamed at.
                                  – Excellll
                                  Mar 14 '16 at 14:57















                                up vote
                                0
                                down vote













                                Just use the text to column feature in data group .. and split your data using ""space"" option use ""concatenate"" to combine these number without spaces.



                                For Example:




                                32 445 423




                                use "text to column"

                                it will return




                                32|445|423




                                use concatenate formula, that will return your required format 32445423






                                share|improve this answer























                                • Welcome to Super User! Don't use all caps in your posts. No one wants to be screamed at.
                                  – Excellll
                                  Mar 14 '16 at 14:57













                                up vote
                                0
                                down vote










                                up vote
                                0
                                down vote









                                Just use the text to column feature in data group .. and split your data using ""space"" option use ""concatenate"" to combine these number without spaces.



                                For Example:




                                32 445 423




                                use "text to column"

                                it will return




                                32|445|423




                                use concatenate formula, that will return your required format 32445423






                                share|improve this answer














                                Just use the text to column feature in data group .. and split your data using ""space"" option use ""concatenate"" to combine these number without spaces.



                                For Example:




                                32 445 423




                                use "text to column"

                                it will return




                                32|445|423




                                use concatenate formula, that will return your required format 32445423







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Mar 18 '16 at 14:07









                                Prasanna

                                3,07722138




                                3,07722138










                                answered Mar 10 '16 at 9:13









                                FAKHAR.UZ.ZAMAN

                                1




                                1












                                • Welcome to Super User! Don't use all caps in your posts. No one wants to be screamed at.
                                  – Excellll
                                  Mar 14 '16 at 14:57


















                                • Welcome to Super User! Don't use all caps in your posts. No one wants to be screamed at.
                                  – Excellll
                                  Mar 14 '16 at 14:57
















                                Welcome to Super User! Don't use all caps in your posts. No one wants to be screamed at.
                                – Excellll
                                Mar 14 '16 at 14:57




                                Welcome to Super User! Don't use all caps in your posts. No one wants to be screamed at.
                                – Excellll
                                Mar 14 '16 at 14:57










                                up vote
                                0
                                down vote













                                Sometimes a space in excel, are not a spaces, try to copy that "space" and pasted in replace dialog instead " ".






                                share|improve this answer

















                                • 2




                                  What do you mean by "a space is not a space"?
                                  – Toto
                                  Sep 20 '17 at 10:36















                                up vote
                                0
                                down vote













                                Sometimes a space in excel, are not a spaces, try to copy that "space" and pasted in replace dialog instead " ".






                                share|improve this answer

















                                • 2




                                  What do you mean by "a space is not a space"?
                                  – Toto
                                  Sep 20 '17 at 10:36













                                up vote
                                0
                                down vote










                                up vote
                                0
                                down vote









                                Sometimes a space in excel, are not a spaces, try to copy that "space" and pasted in replace dialog instead " ".






                                share|improve this answer












                                Sometimes a space in excel, are not a spaces, try to copy that "space" and pasted in replace dialog instead " ".







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Sep 20 '17 at 10:31









                                Rui Miguel Santos

                                1




                                1








                                • 2




                                  What do you mean by "a space is not a space"?
                                  – Toto
                                  Sep 20 '17 at 10:36














                                • 2




                                  What do you mean by "a space is not a space"?
                                  – Toto
                                  Sep 20 '17 at 10:36








                                2




                                2




                                What do you mean by "a space is not a space"?
                                – Toto
                                Sep 20 '17 at 10:36




                                What do you mean by "a space is not a space"?
                                – Toto
                                Sep 20 '17 at 10:36










                                up vote
                                0
                                down vote













                                Try this -



                                =VALUE(SUBSTITUTE(A2,CHAR(160),""))






                                share|improve this answer





















                                • I believe that this works even without  VALUE().
                                  – Scott
                                  Nov 30 at 18:51















                                up vote
                                0
                                down vote













                                Try this -



                                =VALUE(SUBSTITUTE(A2,CHAR(160),""))






                                share|improve this answer





















                                • I believe that this works even without  VALUE().
                                  – Scott
                                  Nov 30 at 18:51













                                up vote
                                0
                                down vote










                                up vote
                                0
                                down vote









                                Try this -



                                =VALUE(SUBSTITUTE(A2,CHAR(160),""))






                                share|improve this answer












                                Try this -



                                =VALUE(SUBSTITUTE(A2,CHAR(160),""))







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Nov 30 at 15:15









                                Aziz Ahmad

                                1




                                1












                                • I believe that this works even without  VALUE().
                                  – Scott
                                  Nov 30 at 18:51


















                                • I believe that this works even without  VALUE().
                                  – Scott
                                  Nov 30 at 18:51
















                                I believe that this works even without  VALUE().
                                – Scott
                                Nov 30 at 18:51




                                I believe that this works even without  VALUE().
                                – Scott
                                Nov 30 at 18:51


















                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Super User!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f308072%2fhow-to-remove-white-space-from-a-number%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Plaza Victoria

                                Brian Clough

                                Cáceres