ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Remove space in front of number in a cell? (https://www.excelbanter.com/excel-worksheet-functions/202991-remove-space-front-number-cell.html)

Barcelona

Remove space in front of number in a cell?
 
I have a column of values I wish to sum. However, the data was imported from
a database and is entered as text - e.g $,100,000

I have removed the $ (=RIGHT) sign and the , (=SUBSTITUTE) but have now
found that there is a space in front of the number.

Is there a simple way to remove the space? I have used REPLACE but this does
not work. I have used =RIGHT but this removes the next number not the space.

Any suggestions?

Mike H

Remove space in front of number in a cell?
 
Hi,

Try this

=TRIM(SUBSTITUTE(A1,"$,",""))*1

Mike

"Barcelona" wrote:

I have a column of values I wish to sum. However, the data was imported from
a database and is entered as text - e.g $,100,000

I have removed the $ (=RIGHT) sign and the , (=SUBSTITUTE) but have now
found that there is a space in front of the number.

Is there a simple way to remove the space? I have used REPLACE but this does
not work. I have used =RIGHT but this removes the next number not the space.

Any suggestions?


Stefi

Remove space in front of number in a cell?
 
=VALUE(TRIM(SUBSTITUTE(RIGHT(A1,LEN(A1)-1),",","")))
returns the pure number.

Regards,
Stefi

€˛Barcelona€¯ ezt Ć*rta:

I have a column of values I wish to sum. However, the data was imported from
a database and is entered as text - e.g $,100,000

I have removed the $ (=RIGHT) sign and the , (=SUBSTITUTE) but have now
found that there is a space in front of the number.

Is there a simple way to remove the space? I have used REPLACE but this does
not work. I have used =RIGHT but this removes the next number not the space.

Any suggestions?


Ashish Mathur[_2_]

Remove space in front of number in a cell?
 
Hi,

I have not reied this but enter 1 in any cell. Then copy it and select the
range. Now go to Edit paste Special Multiply.

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Barcelona" wrote in message
...
I have a column of values I wish to sum. However, the data was imported
from
a database and is entered as text - e.g $,100,000

I have removed the $ (=RIGHT) sign and the , (=SUBSTITUTE) but have now
found that there is a space in front of the number.

Is there a simple way to remove the space? I have used REPLACE but this
does
not work. I have used =RIGHT but this removes the next number not the
space.

Any suggestions?



Barcelona

Remove space in front of number in a cell?
 
THANKS Stefi - don't understand the formula logic, but it worked!


"Stefi" wrote:

=VALUE(TRIM(SUBSTITUTE(RIGHT(A1,LEN(A1)-1),",","")))
returns the pure number.

Regards,
Stefi

€˛Barcelona€¯ ezt Ć*rta:

I have a column of values I wish to sum. However, the data was imported from
a database and is entered as text - e.g $,100,000

I have removed the $ (=RIGHT) sign and the , (=SUBSTITUTE) but have now
found that there is a space in front of the number.

Is there a simple way to remove the space? I have used REPLACE but this does
not work. I have used =RIGHT but this removes the next number not the space.

Any suggestions?


Barcelona

Remove space in front of number in a cell?
 
Mike - Thanks for suggestion. Unfortunately returns a VALUE error.

Stefi's suggestion does though work, so OK for now.


"Mike H" wrote:

Hi,

Try this

=TRIM(SUBSTITUTE(A1,"$,",""))*1

Mike

"Barcelona" wrote:

I have a column of values I wish to sum. However, the data was imported from
a database and is entered as text - e.g $,100,000

I have removed the $ (=RIGHT) sign and the , (=SUBSTITUTE) but have now
found that there is a space in front of the number.

Is there a simple way to remove the space? I have used REPLACE but this does
not work. I have used =RIGHT but this removes the next number not the space.

Any suggestions?



All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com