strip last 4 characters in a text field

P

Patrick

I have a column of text in which I would like to strip off
or truncate the last 4 characters (i.e. 12:00a would be
truncated to 12). Is there a way to do this?

Thanks for your help,
 
B

Biff

Hi!

Here's one way:

=SUBSTITUTE(A1,RIGHT(A1,4),"")

This will return the value 12 as text. If you want to
convert that to a real numeric value:

=--SUBSTITUTE(A1,RIGHT(A1,4),"")

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top