Hi,
I would like excel to do the following.
If the contents of the cell in A1 has a string longer than 4, then delete everything after that 4 or capture just those four, if string is just 4, then do nothing.
Any help would be great.
Hi,
I would like excel to do the following.
If the contents of the cell in A1 has a string longer than 4, then delete everything after that 4 or capture just those four, if string is just 4, then do nothing.
Any help would be great.
Hello,
if you want to change the value in the cell, you will need to use a VBA macro. Are you OK with that?
With a formula, you could just use
=left(A1,4)
in the next cell.
If you want to retain the value in A1 and see only the first four characters in another cell, then you can use a formula like this:
=LEFT(A1,4)
If you want to directly truncate the value in A1 then you can use Text To Columns.
- Select A1
- Data > Text To Columns
- Fixed Width > Next
- Double click on any vertical arrows to remove them. Add an arrow at the 4 point mark. > Next
- Select the area to the right of the vertical line and choose the "Do Not Import Column (skip)" option. > Finish.
Thank you very much
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks