+ Reply to Thread
Results 1 to 10 of 10

Retrieve first number from parentheses

  1. #1
    Registered User
    Join Date
    02-02-2018
    Location
    fremont,ca
    MS-Off Ver
    2016
    Posts
    34

    Retrieve first number from parentheses

    Hello

    Anyone can help se formula to search inside ( ), and pick the first number below?

    so I need to pick like 291188
    291187
    ******
    391629
    396724
    *****
    Thanks,
    James


    • GoVino Red Wine Glass 12/2 Pack 16oz Top Rack Dishwasher Safe (291188-CA)
    • GoVino White Wine Glass 12/2 Pack 12oz Top Rack Dishwasher Safe (291187-CA)
    • GoVino Flute 12/2 Pack 8oz Top Rack Dishwasher Safe (291190-CA)
    • GoVino Red Wine Glass 12/4 Pack 16oz Top Rack Dishwasher Safe (291183-CA)
    • GoVino Red Wine Glass 72/16oz Top Rack Dishwasher Safe (291166-CA)
    • GoVino White Wine Glass 12/4 Pack 12oz Handwash (291193-CA)
    • GoVino Flute 12/4 Pack 8oz Top Rack Dishwasher Safe (291189-CA)
    • GoVino Decanter 12/32oz Top Rack Dishwasher Safe (291186-CA)
    • GoVino White Wine Glass 72/12oz Top Rack Dishwasher Safe (291179-CA)
    • GoVino Red Wine Glass 12/4 Pack 16oz Handwash (291191-CA)
    • GoVino White Wine Glass 12/4 Pack 12oz Top Rack Dishwasher Safe (291192-CA)
    • Rhino 7.75 Black Unwrapped Paper Straw 6mm (391618-CA)
    • Rhino 6 Black Cocktail Paper Straw 8mm (391621-CA)
    • Rhino 7.75 White Unwrapped Paper Straw 6mm (391620-CA)
    • Rhino 5.5 Black Unwrapped Paper Straw 6mm (396723-CA)
    • Rhino 7.75 Black Wrapped Paper Straw 6mm (391619-CA)
    • Rhino 7.75 White Wrapped Paper Straw 6mm (391629-CA)
    • Rhino 5.5 White Unwrapped Paper Straw 6mm (396724-CA)
    Last edited by tao94539; 05-13-2020 at 12:11 PM. Reason: edit title

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,937

    Re: searching

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,937

    Re: Retrieve first number from parentheses

    That's better.

    Now, explain PROPERLY what you are trying to do.

    There are instructions at the top of the page explaining how to attach your sample workbook.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: Retrieve first number from parentheses

    Give this formula a try...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note: This formula assumes the maximum number of characters you will ever have within a single cell is 300.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,937

    Re: Retrieve first number from parentheses

    Alternatively:

    =TRIM(LEFT(SUBSTITUTE(MID(A1,FIND("(",A1)+1,99),"-",REPT(" ",99)),15))

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Retrieve first number from parentheses

    1) Your examples all show one opening parenthesis in the text string. The FIND() function (https://support.office.com/en-us/art...3-d0d89b0a0628 ) can find the open parenthesis and tell you where it is FIND("(",text)
    2) Your examples all show that the number you want is the next 6 characters of the text string. The MID() function (https://support.office.com/en-us/art...8-4ecb12433028 ) can extract a substring from a larger string, using the result of the FIND() function to tell it where to start. =MID(text,FIND(...)+1,6)
    3) the MID() function returns a text string. if you need the number as a number and not text, then you can use the VALUE() function or other strategy to convert the number as text to a real number.

    Assuming that there will always be only one set of parentheses and the number is always the 6 characters immediately after the open parenthesis, that should work to extract the number.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: Retrieve first number from parentheses

    One more possible alternative. If all your numbers are 6 digits long like in your example, then this will work as well...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: Retrieve first number from parentheses

    And, if what follows your numbers is always a dash followed by two characters (and a closing parenthesis), then you could even use this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-02-2018
    Location
    fremont,ca
    MS-Off Ver
    2016
    Posts
    34

    Re: Retrieve first number from parentheses

    Thanks everyone, all solutions work, but I need to dig to understand what is going on

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,937

    Re: Retrieve first number from parentheses

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Searching for next value
    By giggopolous in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-19-2017, 07:34 AM
  2. [SOLVED] VBA for searching the max value
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-24-2012, 03:48 PM
  3. [SOLVED] searching
    By Tom Ogilvy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 06:05 PM
  4. searching
    By Tracy A in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. searching
    By Tracy A in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  6. [SOLVED] searching
    By Tracy A in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. Searching the first name only
    By Kelly Lim in forum Excel General
    Replies: 7
    Last Post: 06-17-2005, 12:05 AM

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