Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

93245 - descr-ip24tion: Q-how do i only extract 93245?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChrisV - 27 Mar 2008 02:08 GMT
Hi,

I have a number and a description (which may at times also contain a number
as well as -) within a cell in excel separated  by a - . How do i extract
only the number at the front as in the subject. Numbers are of varying
lengths.

Regards,

Chris
Pete_UK - 27 Mar 2008 02:22 GMT
Assuming your data is in A1, use this to extract the number before the
hyphen:

=TRIM(LEFT(A1,FIND("-",A1)-1))*1

Your example has a space before the hyphen, so TRIM will get rid of
that. Multiplying by 1 converts the result to a number, but you can
leave this off if you want it as a text value. Copy the formula down
as required.

Hope this helps.

Pete

> Hi,
>
[quoted text clipped - 6 lines]
>
> Chris
Tyro - 27 Mar 2008 02:28 GMT
If there is always a "-" (dash) after the number you could use

=TRIM(LEFT(A1,FIND("-",A1)-1))

That will give you a text string.
If you want a numeric string then

=VALUE(LEFT(A1,FIND("-",A1)-1))

Tyro

> Hi,
>
[quoted text clipped - 7 lines]
>
> Chris
akphidelt - 27 Mar 2008 02:29 GMT
Go To

Data-->Text-to-Columns

Select Delimited, press next

Then click the checkbox Other: and type in -

Then press finish

> Hi,
>
[quoted text clipped - 6 lines]
>
> Chris
Gord Dibben - 28 Mar 2008 01:06 GMT
Before you press Finish, select the columns you don't want and "Do not import
column - skip"

Gord Dibben  MS Excel MVP

>Go To
>
[quoted text clipped - 16 lines]
>>
>> Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.