Search code examples
excelexcel-2013

How to remove a single Leading space in the numeric column in Excel 2013


I really tried a LOT with in-built functions and also with google search but none of the ways doesn't worked out for expected result.

My exact problem is: I've few numeric columns which i got from a website and copied directly into excel.

In those columns there is a SINGLE Leading space at the beginning of each number in the cell of the entire column. Example 523946.00. In this number there is a single space before the digit 5.

I tried a lot with TRIM and SUBSTITUTE in-built functions but nothing able to resolve my problem of removing spaces.

And also my expectation is when i select two or multiple cells in the same column(spaces removed) then automatically Excel should show or display the AVERAGE: <Average value> SUM: <total Sum> COUNT: <count value> at the below status bar or bottom ribbon.

Say, AVERAGE: 175.49 COUNT: 2 SUM: 350.98

This type of information is not showing at the bottom. Only i'm able to see COUNT: 2 alone....why? I want in General Format only. No any special formats.

I'm using MS Excel 2013


Solution

  • First make sure you have the column Formatted as you would like. Make sure it is a number with 2 decimal places (or how ever many you need), then also make sure that there is no Indents (Maybe you think the Indent is a space?) And that you have it Aligned to the Left, Or where you want the Data To be. This alone should take care of your issue.

    If that doesn't work here a list of possible solutions.

    =Value(Trim(A1)) ' Removes all white space before and after the text in A1
    
    =Value(Clean(A1)) 'Removes all non printable Charactersin A1
    
    =Value(SUBSTITUTE(I3," ","")) 'Substitutes(Replaces) all instances of " "(Space) with ""(nothing)
                           '****Note: With Substitute you can also specify how many
                           ' Substitutes(Replaces) to make of the value
    
    =Value(SUBSTITUTE(I3," ","",1)) ' Same as above but with only remove the FIRST space
    
     =Value(Trim(Clean(A1)))    ' Removes all white space before and after the text 
                        ' after removing all Non-Printable Characters
    
    =Value(Trim(Clean(Substitute(A1," ","")))) ' Removes all white space before and after the 
                                        'after removing all Non-Printable Characters
                                        ' And after replaceing all spaces with nothing 
    
    =Value(Right(A1, Len(A1)-1))  ' This takes the End of your text by the number of characters  
                         ' in the value Except the First (In your case should be the Space)
    
    
    =Value(SUBSTITUTE(I6,CHAR(160),"")) 'To help with the non breaking spaces also. 
    

    If nothing works could you please share Why you would like to remove the space? As in what you are trying to do with the data? As maybe that will open more solutions

    With Ole Henrik Skogstrøm's Suggestion added Value around the functions to get the result as a value.