diannao man
New Member
- Joined
- Dec 19, 2011
- Messages
- 7
Hi all
I'm using Excel 2003, Windows XP
I'm trying to get rid of all trailing commas in a text string, for example:
"Steve Smith,,,,,,,,,,,"
"Sarah Golding,,,,,,"
The number of trailing commas varies in a list of 500 names - I've tried a few formulas including these two:
=LEFT(A1,LEN(A1)-1)&SUBSTITUTE(RIGHT(A1), ",", "")
=IF(RIGHT(TRIM(A1),1)=",",LEFT(TRIM(A1),LEN(TRIM(A1))-1),A1)
But these only delete the last comma, where as I'm trying to delete all trailing commas. I've searched these boards somewhat, but can only find formulas similar to the ones above. Can anyone help?
Thanks very much
Diannao man
I'm using Excel 2003, Windows XP
I'm trying to get rid of all trailing commas in a text string, for example:
"Steve Smith,,,,,,,,,,,"
"Sarah Golding,,,,,,"
The number of trailing commas varies in a list of 500 names - I've tried a few formulas including these two:
=LEFT(A1,LEN(A1)-1)&SUBSTITUTE(RIGHT(A1), ",", "")
=IF(RIGHT(TRIM(A1),1)=",",LEFT(TRIM(A1),LEN(TRIM(A1))-1),A1)
But these only delete the last comma, where as I'm trying to delete all trailing commas. I've searched these boards somewhat, but can only find formulas similar to the ones above. Can anyone help?
Thanks very much
Diannao man