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

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?


  #2   Report Post  
Ray A
 
Posts: n/a
Default

Easier way
Highlight column Ctrl + HFind , leave replace blank. This will erase all
of the comma's in the column

"mira" wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?


  #3   Report Post  
mira
 
Posts: n/a
Default

This will not work for my case since the letter is always different.

"Ray A" wrote:

Easier way
Highlight column Ctrl + HFind , leave replace blank. This will erase all
of the comma's in the column

"mira" wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?


  #4   Report Post  
Ray A
 
Posts: n/a
Default

The only change is the removal of the comma. Find the comma and leave the
replace blank.

"mira" wrote:

This will not work for my case since the letter is always different.

"Ray A" wrote:

Easier way
Highlight column Ctrl + HFind , leave replace blank. This will erase all
of the comma's in the column

"mira" wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?

  #5   Report Post  
mira
 
Posts: n/a
Default

I can't do that b/c I don't want to remove all the commas. I want to remove
the comma, the space, and the letter at the end of the string

"Ray A" wrote:

The only change is the removal of the comma. Find the comma and leave the
replace blank.

"mira" wrote:

This will not work for my case since the letter is always different.

"Ray A" wrote:

Easier way
Highlight column Ctrl + HFind , leave replace blank. This will erase all
of the comma's in the column

"mira" wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?



  #6   Report Post  
SVC
 
Posts: n/a
Default

Try: =LEFT(A1,LEN(a1)-3)

This will remove the last three "characters" in the string (i.e., comma,
space and any final letter)

"mira" wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?


  #7   Report Post  
B. R.Ramachandran
 
Posts: n/a
Default

Hi,

=LEFT(A1,LEN(A1)-3) should work (unless I am missing something from your
original posting). Modify A1 appropriately.

Regards,
B.R. Ramachandran
"mira" wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?


  #8   Report Post  
Dave Peterson
 
Posts: n/a
Default

How about:
=left(a1,len(a1)-3)

or maybe:
=if(mid(a1,len(a1)-2,2)=", ",left(a1,len(a1)-3),a1)
just to be careful.

mira wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?


--

Dave Peterson
  #9   Report Post  
mira
 
Posts: n/a
Default

Thanks, Dave!

Both work, but the 2nd one is better for me so I can just drag it down the
column.

THANKS!!!! This has made my job easier!

"Dave Peterson" wrote:

How about:
=left(a1,len(a1)-3)

or maybe:
=if(mid(a1,len(a1)-2,2)=", ",left(a1,len(a1)-3),a1)
just to be careful.

mira wrote:

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 (it varies, and a wildcard
doesn't seem to work) (e.g. ", J"), how do I modify it to remove the last
three characters. I've been playing around with it, but don't know how to
specify the letter as a wildcard, if that's even possible.

I want to to go from Doe, John, W -- Doe, John

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?


--

Dave Peterson

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
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 12:25 AM
limit number of characters in a cell abfabrob Excel Discussion (Misc queries) 9 February 11th 05 04:19 PM
#### error if cell has more than 255 characters Budalacovyek Excel Discussion (Misc queries) 1 December 8th 04 06:42 PM


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

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

About Us

"It's about Microsoft Excel"