Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mira
 
Posts: n/a
Default Removing last character of cell

I am trying to remove a comma which happens to be the last character in the
cell. Does anyone know how to do this?
  #2   Report Post  
AccessExpert
 
Posts: n/a
Default

Mira,

You can use a combination of the Left and Right functions. Insert a blank
column to the right of column you wish to change. In my example I will
assume the data is in column A. Change the formula as necessary.

In the empty cell enter the formula:
=IF(RIGHT(A1,1)=",",LEFT(A1,LEN(A1)-1),A1)

This formula is checking to see if the last character in cell A1 is infact a
comma. If it is the formula will return all of the characters in cell A1
except the last one. If it is not a comma then will just return the entire
contents of cell A1.

Copy this formula down to all the rows necessary. Then Copy the entire
column and paste the values over the original column (A). Make sure you use
the Paste Special and choose the Values Option. Now you should be able to
delete Column B.


"mira" wrote:

I am trying to remove a comma which happens to be the last character in the
cell. Does anyone know how to do this?

  #3   Report Post  
FSt1
 
Posts: n/a
Default

hi,
if all the data has the same number of characters you can use

=left(a1, 6) where a1 is the cell the data is in and 6 is the number of
characters you want to keep. (change it to the number of characters in your
data.)

if your data is different lengths, you can use
dataTextToColumnsdelimitedcomma

but be careful. text to columns will delete data to the right of the column
you are parsing. if you do have data to the right, copy the column you want
to parse to a blank sheet.

regards

FSt1

"mira" wrote:

I am trying to remove a comma which happens to be the last character in the
cell. Does anyone know how to do this?

  #4   Report Post  
Alan
 
Posts: n/a
Default

If its the only comma, use Edit 'Replace , Replace With Nothing
Replace All
If not,
=SUBSTITUTE(A1,RIGHT(A1,1),"")
Paste Special Values to lose the formula's
Regards,
Alan.
"mira" wrote in message
...
I am trying to remove a comma which happens to be the last character in the
cell. Does anyone know how to do this?



  #5   Report Post  
mira
 
Posts: n/a
Default

Thanks, Access Expert! Your formula works really great!

Now, I am trying to use the same formula to remove the last three characters
which contain a comma, a space, and one letter (e.g. , J), how do I modify it
to remove the last part. I've been playing around with it, but don't know
how to specify the letter.

Thanks!

"AccessExpert" wrote:

Mira,

You can use a combination of the Left and Right functions. Insert a blank
column to the right of column you wish to change. In my example I will
assume the data is in column A. Change the formula as necessary.

In the empty cell enter the formula:
=IF(RIGHT(A1,1)=",",LEFT(A1,LEN(A1)-1),A1)

This formula is checking to see if the last character in cell A1 is infact a
comma. If it is the formula will return all of the characters in cell A1
except the last one. If it is not a comma then will just return the entire
contents of cell A1.

Copy this formula down to all the rows necessary. Then Copy the entire
column and paste the values over the original column (A). Make sure you use
the Paste Special and choose the Values Option. Now you should be able to
delete Column B.


"mira" wrote:

I am trying to remove a comma which happens to be the last character in the
cell. Does anyone know how to do this?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
How to know that character type in one cell of xls is more that s. Dharamendra Excel Discussion (Misc queries) 2 March 10th 05 11:26 PM
Fill a cell with a character Anauna New Users to Excel 4 March 4th 05 03:23 AM
Removing a space within a cell JERRY8 Excel Worksheet Functions 3 December 2nd 04 03:22 AM


All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"