Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default How to find values in string? - Urgent!

I have a cell containing for example:

Cell A1: -7 / +18 (%)
Cell A2: -4.5 / +3.5 (pts)

I want to break out the two values into separate cells, for example:
Cell A2 = -7, Cell B2 = 18
Cell A3 = -4.5, Cell B3 = 3.5

Can someone please tell me how?

Regards,

S

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default How to find values in string? - Urgent!

Try this:

1. Highlight cell A1
2. Go to Data - Text to Columns
3. Select Delimited then Next
4. Select Space as the Delimiter then Next
5. Finish

See if that works.


" wrote:

I have a cell containing for example:

Cell A1: -7 / +18 (%)
Cell A2: -4.5 / +3.5 (pts)

I want to break out the two values into separate cells, for example:
Cell A2 = -7, Cell B2 = 18
Cell A3 = -4.5, Cell B3 = 3.5

Can someone please tell me how?

Regards,

S


  #3   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default How to find values in string? - Urgent!

Use these formulas in B1 and C1, copied down.........

=LEFT(A1,FIND("/",A1,1)-2)
=MID(A1,FIND("/",A1,1)+2,99)

Vaya con Dios,
Chuck, CABGx3



" wrote:

I have a cell containing for example:

Cell A1: -7 / +18 (%)
Cell A2: -4.5 / +3.5 (pts)

I want to break out the two values into separate cells, for example:
Cell A2 = -7, Cell B2 = 18
Cell A3 = -4.5, Cell B3 = 3.5

Can someone please tell me how?

Regards,

S


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to find values in string? - Urgent!

Your second formula also extracts the terminal textual part of the string. The
OP only requested the numeric portion.

--ron

On Fri, 15 Sep 2006 04:34:01 -0700, CLR wrote:

Use these formulas in B1 and C1, copied down.........

=LEFT(A1,FIND("/",A1,1)-2)
=MID(A1,FIND("/",A1,1)+2,99)

Vaya con Dios,
Chuck, CABGx3



" wrote:

I have a cell containing for example:

Cell A1: -7 / +18 (%)
Cell A2: -4.5 / +3.5 (pts)

I want to break out the two values into separate cells, for example:
Cell A2 = -7, Cell B2 = 18
Cell A3 = -4.5, Cell B3 = 3.5

Can someone please tell me how?

Regards,

S



--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to find values in string? - Urgent!

On 14 Sep 2006 22:37:33 -0700, wrote:

I have a cell containing for example:

Cell A1: -7 / +18 (%)
Cell A2: -4.5 / +3.5 (pts)

I want to break out the two values into separate cells, for example:
Cell A2 = -7, Cell B2 = 18
Cell A3 = -4.5, Cell B3 = 3.5

Can someone please tell me how?

Regards,

S


Here's one way:

Download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr/


Then use the Regular Expression Formulas:

=REGEX.MID(A1,"[-+]?\d+(\.\d*)?",1) for the first number and
=REGEX.MID(A1,"\d+(\.\d*)?",2) for the second number

These formulas make the assumptions:
1. The FIRST digit in the string is always part of the first value of
interest.
2. All values have a digit before the decimal place. (e.g. 0.007 is
OK but .007 would not be a valid entry).
3. The preceding "+" or "-" signs are optional, but are included in
the extraction for the first value, only (as you show above). It is not
included with the second value.

If any of those assumptions are not correct, the Regular Expression can be
easily modified.


--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default How to find values in string? - Urgent!

You're right Ron, my bad.........will have to put it on my list that I must
learn to read someday <G

Thanks for catching it.

Vaya con Dios,
Chuck, CABGx3



"Ron Rosenfeld" wrote:

Your second formula also extracts the terminal textual part of the string. The
OP only requested the numeric portion.

--ron

On Fri, 15 Sep 2006 04:34:01 -0700, CLR wrote:

Use these formulas in B1 and C1, copied down.........

=LEFT(A1,FIND("/",A1,1)-2)
=MID(A1,FIND("/",A1,1)+2,99)

Vaya con Dios,
Chuck, CABGx3



" wrote:

I have a cell containing for example:

Cell A1: -7 / +18 (%)
Cell A2: -4.5 / +3.5 (pts)

I want to break out the two values into separate cells, for example:
Cell A2 = -7, Cell B2 = 18
Cell A3 = -4.5, Cell B3 = 3.5

Can someone please tell me how?

Regards,

S



--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
find a cell matching separate column and row values LQEngineer Excel Worksheet Functions 2 July 26th 06 07:10 AM
comparing two columns of data to find common values patman Excel Discussion (Misc queries) 2 July 25th 06 03:05 PM
Find two values in worksheet to return one value Correna Excel Worksheet Functions 10 May 4th 06 10:22 PM
How do I compare string values in one column to another column? Nick N. Excel Worksheet Functions 1 April 29th 06 02:56 AM
Find which values sum up another vaule, please help! samsg Excel Discussion (Misc queries) 0 February 27th 06 12:18 AM


All times are GMT +1. The time now is 04:18 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"