+ Reply to Thread
Results 1 to 15 of 15

Extract Unique IDs

  1. #1
    Registered User
    Join Date
    12-19-2019
    Location
    USA
    MS-Off Ver
    Office2016
    Posts
    14

    Extract Unique IDs

    Hi everyone - Is there a way to ONLY extract data from between 2 parenthesis if the data is a number? See attached workbook.
    Attached Files Attached Files

  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,734

    Re: Extract Unique IDs

    In C2 copied down:

    =IFERROR(--SUBSTITUTE(MID(A2,FIND("(",A2)+1,99),")",""),"")
    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 Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Extract Unique IDs

    Into C2:
    (As I know from your other post ID are always 6 digits long)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and drag it down.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    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,734

    Re: Extract Unique IDs

    I think you are over-thinking it again ...

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Extract Unique IDs

    Another option, if it's always a 6digit number
    =IFERROR(SUBSTITUTE(RIGHT(A2,7),")","")+0,"")

  6. #6
    Registered User
    Join Date
    12-19-2019
    Location
    USA
    MS-Off Ver
    Office2016
    Posts
    14

    Re: Extract Unique IDs

    WOW, again both great answers and both worked! You guys are amazing. Thank you so much. I will mark the thread as resolved. Happy new year!

  7. #7
    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,734

    Re: Extract Unique IDs

    Happy New Year!

  8. #8
    Registered User
    Join Date
    12-19-2019
    Location
    USA
    MS-Off Ver
    Office2016
    Posts
    14

    Re: Extract Unique IDs

    Hi everyone - I forgot to add a situation to the example (my apologies). This is another data point
    John Smith (10127677)[C]

    As you can see, there is a [C] at the end. I also need to ignore that and still extract the 8 digit ID. Can you help me modify the formula? The current one just skips over this record and gives me a blank .

  9. #9
    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,734

    Re: Extract Unique IDs

    I’m away from the PC now, but will look in again in the morning to see if you still need help.

  10. #10
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Extract Unique IDs

    this is an adjustment to what Ali gave you AND it assumes that if it exists it will always be [C]...
    =IFERROR(--SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("(",A2)+1,99),")",""),"[C]",""),"")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  11. #11
    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,734

    Re: Extract Unique IDs

    Thanks for the assist, Sam.

  12. #12
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Extract Unique IDs

    You're welcome Ali, I was trying to come up with my own when you already posted and I was also over thinking it and yours looked so efficient. A little tweak wasn't much to add.

  13. #13
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Extract Unique IDs

    Just in case if ID change to 7 or 9 and something like [X] or [DF] appear:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  14. #14
    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,734

    Re: Extract Unique IDs

    This is a bit shorter:

    =IFERROR(--TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("(",A2)+1,99),")",""),"[",REPT(" ",99)),98)),"")

  15. #15
    Registered User
    Join Date
    12-19-2019
    Location
    USA
    MS-Off Ver
    Office2016
    Posts
    14

    Re: Extract Unique IDs

    Thank you everyone! Worked like a charm. I'll mark this as resolved.

+ 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. Replies: 8
    Last Post: 08-16-2019, 10:59 AM
  2. [SOLVED] Extract one unique value from three
    By Supersadie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2018, 07:20 AM
  3. Extract unique list
    By BRISBANEBOB in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-03-2018, 03:34 AM
  4. Formula to extract unique value
    By Niclal in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 11-08-2016, 05:49 PM
  5. Extract All Unique Values
    By Jbm444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2010, 06:44 PM
  6. Extract Unique Values, Then Extract Again to Remove Suffixes
    By Karl Burrows in forum Excel General
    Replies: 23
    Last Post: 06-25-2005, 08:05 PM

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