Remove Characters from String in Excel

p4nny

Board Regular
Joined
Jan 13, 2015
Messages
246
Hi

I would like to remove the remove characters after the final "." so the below would read 15.3.9.6

The only trouble I'm having is the final "." is in varied position.

Much appreciated

[TABLE="width: 125"]
<tbody>[TR]
[TD]15.3.9.6.9[/TD]
[/TR]
[TR]
[TD]15.3.9.6.10[/TD]
[/TR]
[TR]
[TD]15.3.9.6.11[/TD]
[/TR]
[TR]
[TD]15.3.9.6.12[/TD]
[/TR]
[TR]
[TD]15.3.9.6.13[/TD]
[/TR]
</tbody>[/TABLE]

thank you
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Book1
AB
115.3.9.6.915.3.9.6
215.3.9.6.1015.3.9.6
315.3.9.6.1115.3.9.6
415.3.9.6.1215.3.9.6
515.3.9.6.1315.3.9.6
Sheet1
Cell Formulas
RangeFormula
B1=IFERROR(LEFT($A1,FIND(CHAR(1),SUBSTITUTE($A1,".",CHAR(1),LEN($A1)-LEN(SUBSTITUTE($A1,".",""))))-1),$A1)


WBD
 
Upvote 0
If the number of characters before the last "." is the same as in your sample data, you can use:

Code:
=LEFT(A1,8)

Otherwise; you may use the below formula, which extracts the string before the 3rd occurence of "."

Code:
=LEFT(A1,FIND(".",A1,FIND(".",A1)+3)+1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,225,743
Messages
6,186,777
Members
453,370
Latest member
juliewar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top