Remove variable text in cells

G

Guest

Hi,

I have a list of data that I want to edit and have tried LEFT,RIGHT & MIDDLE
formulas for editing with no luck.
Eg.

00123456 draft plan v.1 19-05-05
0012457 compliance plan v.2 26-06-05
012348 national business strategy v.2 07-06-05

I want to remove the date from each cell so it reads
00123456 draft plan v.1
0012457 compliance plan v.2
012348 national business strategy v.2

But because the cell characters vary and there isn't a common delimeter(-, _
.. ) I can't get excel to remove the date (last 8 digits) from the right.

Any help would be greatly appreciated becuase it's driving me crazy
 
G

Guest

If the data always ends in the date in this format then:

=LEFT(A1,LEN(A1)-9)

Hope this helps
Rowan
 
M

Max

One way ..

Assuming data is in col A, A1 down

Try in say, B1:

=LEFT(TRIM(A1),SEARCH(" ",TRIM(A1),SEARCH(".",TRIM(A1))))

Copy B1 down
 
H

Harlan Grove

Max wrote...
One way ..

Assuming data is in col A, A1 down

Try in say, B1:

=LEFT(TRIM(A1),SEARCH(" ",TRIM(A1),SEARCH(".",TRIM(A1))))
....

Could fail when there's more than one period in the text.

If the ending substring could be variable length but always preceded by
a space, it's possible to use

=LEFT(TRIM(A1),LOOKUP(2,1/(MID(TRIM(A1),ROW(INDIRECT("1:256")),1)=" "),
ROW(INDIRECT("1:256")))-1)

This relies on the functionality of the LOOKUP formula as it's worked
from Excel 97 through Excel 2003 (and probably in earlier versions as
well).
 

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