Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to retrieve the value within string?

There is a string in cell A1, such as
......... .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within string?
Thanks in advance for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How to retrieve the value within string?

Eric,

Try this which assumes it's the first set of parenthesis in the cell

=MID(A1,FIND("(",A1)+1,FIND(")",A1,FIND("(",A1))-FIND("(",A1)-2)/100
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Eric" wrote:

There is a string in cell A1, such as
........ .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within string?
Thanks in advance for any suggestions
Eric

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How to retrieve the value within string?

forgot to mention.format as a percentage
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Mike H" wrote:

Eric,

Try this which assumes it's the first set of parenthesis in the cell

=MID(A1,FIND("(",A1)+1,FIND(")",A1,FIND("(",A1))-FIND("(",A1)-2)/100
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Eric" wrote:

There is a string in cell A1, such as
........ .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within string?
Thanks in advance for any suggestions
Eric

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How to retrieve the value within string?

Another way

will handle

.......(3.25%)
------(3.25%)..............

'As text
=REPLACE(MID(A1,FIND("(",A1)+1,255),FIND(")",MID(A 1,
FIND("(",A1)+1,255)),255,"")

'As percentage (format the cell)

=--REPLACE(MID(A1,FIND("(",A1)+1,255),FIND(")",MID(A1 ,
FIND("(",A1)+1,255)),255,"")


--
Jacob (MVP - Excel)


"Eric" wrote:

There is a string in cell A1, such as
........ .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within string?
Thanks in advance for any suggestions
Eric

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to retrieve the value within string?

On Mon, 19 Apr 2010 03:29:01 -0700, Eric
wrote:

There is a string in cell A1, such as
........ .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within string?
Thanks in advance for any suggestions
Eric


Assuming no parenthesis prior to the desired enclosu

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

--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to retrieve the value within string?

On Mon, 19 Apr 2010 07:43:38 -0400, Ron Rosenfeld
wrote:

On Mon, 19 Apr 2010 03:29:01 -0700, Eric
wrote:

There is a string in cell A1, such as
........ .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within string?
Thanks in advance for any suggestions
Eric


Assuming no parenthesis prior to the desired enclosu

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

--ron


OH, and if you want to convert the text to a value, as the other respondents
seem to be assuming, you can merely precede the above with a double unary:

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

--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default How to retrieve the value within string?

Note that it needs to be double unary MINUS. Double unary PLUS wouldn't
work.
--
David Biddulph


"Ron Rosenfeld" wrote in message
...
On Mon, 19 Apr 2010 07:43:38 -0400, Ron Rosenfeld

wrote:

On Mon, 19 Apr 2010 03:29:01 -0700, Eric
wrote:

There is a string in cell A1, such as
........ .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within
string?
Thanks in advance for any suggestions
Eric


Assuming no parenthesis prior to the desired enclosu

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

--ron


OH, and if you want to convert the text to a value, as the other
respondents
seem to be assuming, you can merely precede the above with a double unary:

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

--ron



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to retrieve the value within string?

Here's another one...

=--SUBSTITUTE(MID(A1,FIND("(",A1)+1,10),")","")

Format as Percentage

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
There is a string in cell A1, such as
........ .... (3.25%)
I would like to retrieve the text inside (), which should return 3.25% in
cell B1.
Does anyone have any suggestions on how to retrieve the text within
string?
Thanks in advance for any suggestions
Eric



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to retrieve the value within string?

On Mon, 19 Apr 2010 21:15:41 +0100, "David Biddulph" <groups [at]
biddulph.org.uk wrote:

Note that it needs to be double unary MINUS. Double unary PLUS wouldn't
work.
--


As in the example I gave.

And I don't believe that Excel ever interprets (or uses) the '+' sign as a
unary operator.
--ron
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to retrieve the value within string?

On Mon, 19 Apr 2010 18:28:24 -0400, "T. Valko" wrote:

Here's another one...

=--SUBSTITUTE(MID(A1,FIND("(",A1)+1,10),")","")

Format as Percentage


I believe that requires that the ")" is the last non-space character
--ron


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to retrieve the value within string?

Yes, that's how I interpreted this:

There is a string in cell A1, such as
........ .... (3.25%)


--
Biff
Microsoft Excel MVP


"Ron Rosenfeld" wrote in message
...
On Mon, 19 Apr 2010 18:28:24 -0400, "T. Valko"
wrote:

Here's another one...

=--SUBSTITUTE(MID(A1,FIND("(",A1)+1,10),")","")

Format as Percentage


I believe that requires that the ")" is the last non-space character
--ron



  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to retrieve the value within string?

On Mon, 19 Apr 2010 22:09:29 -0400, "T. Valko" wrote:

Yes, that's how I interpreted this:

There is a string in cell A1, such as
........ .... (3.25%)



I agree that is consistent with his example, although his textual description
allows for characters after, but does not definitely indicate there could be.

--ron
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
How to retrieve certain char within a string? Eric Excel Discussion (Misc queries) 1 July 3rd 07 03:02 AM
How to retrieve certain text from string? Eric Excel Discussion (Misc queries) 5 December 3rd 06 07:48 PM
How to retrieve certain text from string? Eric Excel Worksheet Functions 2 December 3rd 06 02:06 PM
How to retrieve character from a string for excel? Eric Excel Discussion (Misc queries) 1 September 4th 06 08:20 AM
How do I retrieve the text string from the right of a cell JWG Excel Worksheet Functions 4 June 9th 06 03:28 AM


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

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"