Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Stan Altshuller
 
Posts: n/a
Default Extract numbers from strings

Hi All!


How do I extract a number from a string? Example:
cell D64 has a string "Q30 no lockup" in my case, the first char is always
a letter and the next two chars form a number I need to extract.
When I try
=N(right(left(D64,3),2)) it returns 0 I need 30. I need ultimately to find
the average of these numbers in the strings running across.
Help?

THANKS!
Stan



  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Stan,

One way

=--RIGHT(D4,2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stan Altshuller" wrote in message
...
Hi All!


How do I extract a number from a string? Example:
cell D64 has a string "Q30 no lockup" in my case, the first char is

always
a letter and the next two chars form a number I need to extract.
When I try
=N(right(left(D64,3),2)) it returns 0 I need 30. I need ultimately to

find
the average of these numbers in the strings running across.
Help?

THANKS!
Stan





  #3   Report Post  
Stan Altshuller
 
Posts: n/a
Default

it works!
how would one know that? I can not find help on this -- function. amazing
:) anyway THANKS for replying so quickly.

Stan


"Bob Phillips" wrote in message
...
Hi Stan,

One way

=--RIGHT(D4,2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stan Altshuller" wrote in message
...
Hi All!


How do I extract a number from a string? Example:
cell D64 has a string "Q30 no lockup" in my case, the first char is

always
a letter and the next two chars form a number I need to extract.
When I try
=N(right(left(D64,3),2)) it returns 0 I need 30. I need ultimately to

find
the average of these numbers in the strings running across.
Help?

THANKS!
Stan







  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stan Altshuller" wrote in message
...
it works!
how would one know that? I can not find help on this -- function. amazing
:) anyway THANKS for replying so quickly.

Stan


"Bob Phillips" wrote in message
...
Hi Stan,

One way

=--RIGHT(D4,2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stan Altshuller" wrote in message
...
Hi All!


How do I extract a number from a string? Example:
cell D64 has a string "Q30 no lockup" in my case, the first char is

always
a letter and the next two chars form a number I need to extract.
When I try
=N(right(left(D64,3),2)) it returns 0 I need 30. I need ultimately to

find
the average of these numbers in the strings running across.
Help?

THANKS!
Stan









  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

It's the RIGHT that does the work, the -- just ensures it is a number. You
can get the same result with

=VALUE(RIGHT(D4,2))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stan Altshuller" wrote in message
...
it works!
how would one know that? I can not find help on this -- function. amazing
:) anyway THANKS for replying so quickly.

Stan


"Bob Phillips" wrote in message
...
Hi Stan,

One way

=--RIGHT(D4,2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stan Altshuller" wrote in message
...
Hi All!


How do I extract a number from a string? Example:
cell D64 has a string "Q30 no lockup" in my case, the first char is

always
a letter and the next two chars form a number I need to extract.
When I try
=N(right(left(D64,3),2)) it returns 0 I need 30. I need ultimately to

find
the average of these numbers in the strings running across.
Help?

THANKS!
Stan











  #6   Report Post  
Dana DeLouis
 
Posts: n/a
Default

=N(right(left(D64,3),2))

Instead of using Right & Left, using Mid might be an option:

The following would return 30 from "Q30 no lockup"

=VALUE(MID(A1,2,2))
or:
=--(MID(A1,2,2))

HTH
--
Dana DeLouis
Win XP & Office 2003

"Stan Altshuller" wrote in message
...
Hi All!


How do I extract a number from a string? Example:
cell D64 has a string "Q30 no lockup" in my case, the first char is
always
a letter and the next two chars form a number I need to extract.
When I try
=N(right(left(D64,3),2)) it returns 0 I need 30. I need ultimately to
find
the average of these numbers in the strings running across.
Help?

THANKS!
Stan





  #7   Report Post  
Myrna Larson
 
Posts: n/a
Default

The function that is intended for this sort of thing (i.e. you know where the
text begins (2nd char) and how long it is (2 chars) is MID.

=--MID(D4,2,2)


On Thu, 17 Feb 2005 09:55:09 -0500, "Stan Altshuller"
wrote:

it works!
how would one know that? I can not find help on this -- function. amazing
:) anyway THANKS for replying so quickly.

Stan


"Bob Phillips" wrote in message
...
Hi Stan,

One way

=--RIGHT(D4,2)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stan Altshuller" wrote in message
...
Hi All!


How do I extract a number from a string? Example:
cell D64 has a string "Q30 no lockup" in my case, the first char is

always
a letter and the next two chars form a number I need to extract.
When I try
=N(right(left(D64,3),2)) it returns 0 I need 30. I need ultimately to

find
the average of these numbers in the strings running across.
Help?

THANKS!
Stan







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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 10:19 PM
Sorting imported "numbers" Confused on the tundra Excel Discussion (Misc queries) 5 December 17th 04 07:33 PM
How do you extract numbers from a string of chacters in a cell (E. blackbeemer Excel Worksheet Functions 6 November 12th 04 09:00 AM


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