ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Spacing in cells is preventing addition (https://www.excelbanter.com/excel-worksheet-functions/109233-spacing-cells-preventing-addition.html)

kris

Spacing in cells is preventing addition
 
I copied and pasted a spreadsheet to EXCEL 2003 and the cells have spaces in
front of the numbers preventing the addition function. How do I fix this?

Ron Rosenfeld

Spacing in cells is preventing addition
 
On Sat, 9 Sep 2006 07:41:02 -0700, Kris wrote:

I copied and pasted a spreadsheet to EXCEL 2003 and the cells have spaces in
front of the numbers preventing the addition function. How do I fix this?


=--TRIM(A1)
=--SUBSTITUTE(TRIM(A1),CHAR(160),"")

CHAR(160) is a non-printing space frequently found in HTML documents.



--ron

Nobody

Spacing in cells is preventing addition
 
=TRIM(A1)

copy all the way down

---------------
mama no teeth

"Kris" wrote:

I copied and pasted a spreadsheet to EXCEL 2003 and the cells have spaces in
front of the numbers preventing the addition function. How do I fix this?


kris

Spacing in cells is preventing addition
 
Can you demonstrate,I tried and it is not working for me. Please see an
example below:

1,016.28 0.00
4,578.00 0.00
0.00 1,016.28
0.00 4,578.00
0.00 4,578.00
0.00 1,600.32
0.00 1,600.32

The grid did not copy: however, the above would be in cells.

"Ron Rosenfeld" wrote:

On Sat, 9 Sep 2006 07:41:02 -0700, Kris wrote:

I copied and pasted a spreadsheet to EXCEL 2003 and the cells have spaces in
front of the numbers preventing the addition function. How do I fix this?


=--TRIM(A1)
=--SUBSTITUTE(TRIM(A1),CHAR(160),"")

CHAR(160) is a non-printing space frequently found in HTML documents.



--ron


Ron Rosenfeld

Spacing in cells is preventing addition
 
On Sat, 9 Sep 2006 08:58:01 -0700, Kris wrote:

Can you demonstrate,I tried and it is not working for me. Please see an
example below:

1,016.28 0.00
4,578.00 0.00
0.00 1,016.28
0.00 4,578.00
0.00 4,578.00
0.00 1,600.32
0.00 1,600.32

The grid did not copy: however, the above would be in cells.

"Ron Rosenfeld" wrote:

On Sat, 9 Sep 2006 07:41:02 -0700, Kris wrote:

I copied and pasted a spreadsheet to EXCEL 2003 and the cells have spaces in
front of the numbers preventing the addition function. How do I fix this?


=--TRIM(A1)
=--SUBSTITUTE(TRIM(A1),CHAR(160),"")

CHAR(160) is a non-printing space frequently found in HTML documents.



--ron


I don't see an example of what you did.

In general, those formulas will convert a string of numbers with leading or
following spaces into a real number. So if your values are in A1:B7, you could
put the formula into C1 and copy down to row 7, then across to column D. Those
results would be numbers that you could do arithmetic on.

For the information you posted, I merely pasted it into a worksheet and had no
problem with addition. It is already numeric.

When you write, "the above would be in cells", what do you mean? Is each value
in a separate cell? Or are there several values on one cell? If the latter,
which cell?


--ron


All times are GMT +1. The time now is 10:03 PM.

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