Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Need SUBSTRING like function

Greetings all. Let's say I have "AAAA - ABCD" in a cell. I need to extract
only the portion of text after the space after the hyphen. So, from the
example, I would need to extract "ABCD". With TSQL I can do it like this...

REVERSE(SUBSTRING(REVERSE('AAAA-ABCD'),1,4))

Or I can do...

RIGHT('AAAA - ABCD',4)

Are there any functions in Excel that would allow me to do this? In
reality, the field has a variable length before the hyphen, but the string
after the hypen is *always* = 8. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Need SUBSTRING like function

Try

=TRIM(MID(A1,FIND("-",A1)+1,LEN(A1)))

Mike

"Greg Snidow" wrote:

Greetings all. Let's say I have "AAAA - ABCD" in a cell. I need to extract
only the portion of text after the space after the hyphen. So, from the
example, I would need to extract "ABCD". With TSQL I can do it like this...

REVERSE(SUBSTRING(REVERSE('AAAA-ABCD'),1,4))

Or I can do...

RIGHT('AAAA - ABCD',4)

Are there any functions in Excel that would allow me to do this? In
reality, the field has a variable length before the hyphen, but the string
after the hypen is *always* = 8. Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Need SUBSTRING like function

Greg
If the text string to be extracted from the right hand end is *always* 8
characters then you can use =RIGHT(A1,8)

"Greg Snidow" wrote:

Greetings all. Let's say I have "AAAA - ABCD" in a cell. I need to extract
only the portion of text after the space after the hyphen. So, from the
example, I would need to extract "ABCD". With TSQL I can do it like this...

REVERSE(SUBSTRING(REVERSE('AAAA-ABCD'),1,4))

Or I can do...

RIGHT('AAAA - ABCD',4)

Are there any functions in Excel that would allow me to do this? In
reality, the field has a variable length before the hyphen, but the string
after the hypen is *always* = 8. Thank you.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Need SUBSTRING like function

Thanks David and Mike. I guess I should have thought to check if Excel has a
RIGHT function. Most of the time my translating SQL into Excel is not so
gravy.

"David" wrote:

Greg
If the text string to be extracted from the right hand end is *always* 8
characters then you can use =RIGHT(A1,8)

"Greg Snidow" wrote:

Greetings all. Let's say I have "AAAA - ABCD" in a cell. I need to extract
only the portion of text after the space after the hyphen. So, from the
example, I would need to extract "ABCD". With TSQL I can do it like this...

REVERSE(SUBSTRING(REVERSE('AAAA-ABCD'),1,4))

Or I can do...

RIGHT('AAAA - ABCD',4)

Are there any functions in Excel that would allow me to do this? In
reality, the field has a variable length before the hyphen, but the string
after the hypen is *always* = 8. Thank you.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Substring Petya Excel Discussion (Misc queries) 0 February 15th 07 02:53 PM
Substring-esque function Raman325[_32_] Excel Programming 2 March 10th 06 06:52 PM
is there any substring function in macro? ashishprem[_5_] Excel Programming 2 February 20th 06 07:58 AM
can I execute and 'substring' function in Excel Larry Excel Worksheet Functions 4 January 1st 06 08:16 PM
subString function in Excel(Urgent) Varinder Excel Programming 2 October 1st 03 10:37 AM


All times are GMT +1. The time now is 10:18 PM.

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

About Us

"It's about Microsoft Excel"