#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
BG BG is offline
external usenet poster
 
Posts: 31
Default Mid or Right

Good Morning,
Is there a way to take data from the point in the cell that it contains a -
(hyphen)
for example, the length can chg but it will always be 6 numbers and then a
hypen and then the part I want (ie . Sales order 1 etc..)

123456 - Sales order 1
234567 - Sales order 15



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default Mid or Right

=right(A2,len(A2)-find("- ",A2))

Added a space at the end of the find to ensure you start with the alpha.

"bg" wrote:

Good Morning,
Is there a way to take data from the point in the cell that it contains a -
(hyphen)
for example, the length can chg but it will always be 6 numbers and then a
hypen and then the part I want (ie . Sales order 1 etc..)

123456 - Sales order 1
234567 - Sales order 15



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Mid or Right

Try

=MID(A1,FIND("-",A1)+2,LEN(A1))

where A1 has the original data. This assumes that there is indeed a
"-" character in the string.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Fri, 28 Aug 2009 08:49:01 -0700, bg
wrote:

Good Morning,
Is there a way to take data from the point in the cell that it contains a -
(hyphen)
for example, the length can chg but it will always be 6 numbers and then a
hypen and then the part I want (ie . Sales order 1 etc..)

123456 - Sales order 1
234567 - Sales order 15


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Mid or Right

Try this...

=MID(A1,FIND("-",A1)+2,255)

--
Biff
Microsoft Excel MVP


"bg" wrote in message
...
Good Morning,
Is there a way to take data from the point in the cell that it contains
a -
(hyphen)
for example, the length can chg but it will always be 6 numbers and then a
hypen and then the part I want (ie . Sales order 1 etc..)

123456 - Sales order 1
234567 - Sales order 15





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Mid or Right

Another way to do it is to copy the range (a single column) to where you want
it.

Select that new column (or the old column if you can lose the original text)
Edit|Replace
what: (spacebar)* (space character followed by an asterisk)
with: (leave blank)
replace all

This will leave the leading digits--but it'll become a real number. You may
want to format it to keep any leading 0's.

Format|cells|number tab|Custom
000000




bg wrote:

Good Morning,
Is there a way to take data from the point in the cell that it contains a -
(hyphen)
for example, the length can chg but it will always be 6 numbers and then a
hypen and then the part I want (ie . Sales order 1 etc..)

123456 - Sales order 1
234567 - Sales order 15


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Mid or Right

You say the hyphen comes immediately after your 6 digit number, but your
examples show a space between them and also one after the hyphen. So, if
there really are *no* spaces in either location, then you can use this...

=MID(A1,8,99)

where the 99 assumes your text after the hyphen is no longer than 99
characters in length (if it can be, just make the 99 value larger). If there
are spaces in both locations, you can do this instead...

=MID(A1,10,99)

If there is no space before the dash, but there might or might not be a
space after it, then you can do this...

=TRIM(MID(A1,9,99))

--
Rick (MVP - Excel)


"bg" wrote in message
...
Good Morning,
Is there a way to take data from the point in the cell that it contains
a -
(hyphen)
for example, the length can chg but it will always be 6 numbers and then a
hypen and then the part I want (ie . Sales order 1 etc..)

123456 - Sales order 1
234567 - Sales order 15




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Mid or Right

And if you are using 2007 you may have very long text entries in the cell, in
which case

=MID(C6,9,9^9)

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"bg" wrote:

Good Morning,
Is there a way to take data from the point in the cell that it contains a -
(hyphen)
for example, the length can chg but it will always be 6 numbers and then a
hypen and then the part I want (ie . Sales order 1 etc..)

123456 - Sales order 1
234567 - Sales order 15



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"