+ Reply to Thread
Results 1 to 7 of 7

Extract numbers from strings

  1. #1
    Stan Altshuller
    Guest

    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. #2
    Bob Phillips
    Guest

    Re: Extract numbers from strings

    Hi Stan,

    One way

    =--RIGHT(D4,2)

    --

    HTH

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


    "Stan Altshuller" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Stan Altshuller
    Guest

    Re: Extract numbers from strings

    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" <[email protected]> wrote in message
    news:evKk%[email protected]...
    > Hi Stan,
    >
    > One way
    >
    > =--RIGHT(D4,2)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Stan Altshuller" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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. #4
    Bob Phillips
    Guest

    Re: Extract numbers from strings



    --

    HTH

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


    "Stan Altshuller" <[email protected]> wrote in message
    news:e%[email protected]...
    > 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" <[email protected]> wrote in message
    > news:evKk%[email protected]...
    > > Hi Stan,
    > >
    > > One way
    > >
    > > =--RIGHT(D4,2)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Stan Altshuller" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > 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. #5
    Bob Phillips
    Guest

    Re: Extract numbers from strings

    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" <[email protected]> wrote in message
    news:e%[email protected]...
    > 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" <[email protected]> wrote in message
    > news:evKk%[email protected]...
    > > Hi Stan,
    > >
    > > One way
    > >
    > > =--RIGHT(D4,2)
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Stan Altshuller" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > 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. #6
    Dana DeLouis
    Guest

    Re: Extract numbers from strings

    > =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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #7
    Myrna Larson
    Guest

    Re: Extract numbers from strings

    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" <[email protected]>
    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" <[email protected]> wrote in message
    >news:evKk%[email protected]...
    >> Hi Stan,
    >>
    >> One way
    >>
    >> =--RIGHT(D4,2)
    >>
    >> --
    >>
    >> HTH
    >>
    >> RP
    >> (remove nothere from the email address if mailing direct)
    >>
    >>
    >> "Stan Altshuller" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1