+ Reply to Thread
Results 1 to 10 of 10

Formula that pulls only set of characters that contain numbers

  1. #1
    Registered User
    Join Date
    08-13-2018
    Location
    U.S
    MS-Off Ver
    2016
    Posts
    53

    Red face Formula that pulls only set of characters that contain numbers

    Hey Guys!

    I have a ton of listing titles for products I sell and I am trying to pull the part numbers out into a separate column. Is there a way to pull only the groups of words or parts numbers that contain a number? Please see example below:


    240356406 - Sears Kenmore Refrigerator Door Bin Shelf Bucket White Replacement
    Frigidaire Refrigerator Door Bin Shelf Bucket Clear AH430122 EA430122 891214
    240356409 - Frigidaire Refrigerator Door Bin Shelf Bucket White Replacement
    Sears Kenmore Refrigerator Door Bin Shelf Bucket White AH430121 EA430121 891213
    240356402 - Frigidaire Refrigerator Door Bin Shelf Bucket Clear Replacement
    240356414 - Sears Kenmore Refrigerator Door Bin Shelf Bucket Clear Replacement


    I would like a separate column to pull out the following (because these sets of characters have numbers in them)


    240356406
    AH430122 EA430122 891214
    240356409
    AH430121 EA430121 891213
    240356402
    240356414


    This would save me a ton of time. Thanks in advance for any assistance you can provide!

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Formula that pulls only set of characters that contain numbers

    Is there case where alphabet will be after the number portion? Ex. 430121AB

    If not, it's relatively easy to do with PowerQuery/Get & Transform.

    If it could... then you can still do it via PowerQuery but will require writing custom function. Probably much easier using VBA with RegEx in that case.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    08-13-2018
    Location
    U.S
    MS-Off Ver
    2016
    Posts
    53

    Re: Formula that pulls only set of characters that contain numbers

    Quote Originally Posted by CK76 View Post
    Is there case where alphabet will be after the number portion? Ex. 430121AB

    If not, it's relatively easy to do with PowerQuery/Get & Transform.

    If it could... then you can still do it via PowerQuery but will require writing custom function. Probably much easier using VBA with RegEx in that case.


    Yes, the part number could end with letters as well. 430121AB is a possibility! Not sure if it matters or not but the part number could also have a "-" so 4301-21AB could also be possible. Thanks!

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Formula that pulls only set of characters that contain numbers

    Yes that would matter quite a bit. Can you upload sample workbook that has more sample (about 50) that represent your actual data set?

    To upload, use "Go Advanced" button and follow "Manage Attachments" hyperlink. It will launch new tab/window for managing uploads.

  5. #5
    Registered User
    Join Date
    08-13-2018
    Location
    U.S
    MS-Off Ver
    2016
    Posts
    53

    Re: Formula that pulls only set of characters that contain numbers

    Quote Originally Posted by CK76 View Post
    Yes that would matter quite a bit. Can you upload sample workbook that has more sample (about 50) that represent your actual data set?

    To upload, use "Go Advanced" button and follow "Manage Attachments" hyperlink. It will launch new tab/window for managing uploads.
    Please see attached! Thanks!
    Attached Files Attached Files

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Formula that pulls only set of characters that contain numbers

    Try something like below.
    Please Login or Register  to view this content.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,701

    Re: Formula that pulls only set of characters that contain numbers

    Here is a version with a UDF.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  8. #8
    Registered User
    Join Date
    08-13-2018
    Location
    U.S
    MS-Off Ver
    2016
    Posts
    53

    Re: Formula that pulls only set of characters that contain numbers

    Quote Originally Posted by CK76 View Post
    Try something like below.
    Please Login or Register  to view this content.


    Thank you Thank you Thank you! This works great! I have a couple listings titles that include 3 letter words in caps that it seems to be pulling as a part number. Example "PTC" and "ERP" .. These are brand names and will not be connected to a part number. I guess I can fun a find and replace on those after though. Thanks again for your help with this! Saved me a ton of time.

  9. #9
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Formula that pulls only set of characters that contain numbers

    You are welcome

    Actually, I like Jeff's code better. It will be more precise than the pattern I used. And will handle the issue that you mention.
    If you want to make his code into sub. Something like below would do it.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-13-2018
    Location
    U.S
    MS-Off Ver
    2016
    Posts
    53

    Re: Formula that pulls only set of characters that contain numbers

    Thank you guys so much!!!

+ 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. [SOLVED] Formula Extracting numbers and text between specific characters
    By keith81591 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2018, 03:08 PM
  2. [SOLVED] How to write a formula that pulls in another string of formula from another cell
    By raging_turtle in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-21-2016, 04:17 AM
  3. Find characters in a cell containing characters and numbers
    By T86157 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-02-2016, 08:21 PM
  4. [SOLVED] Function that pulls the middle characters of a cell
    By bbrunof in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-18-2013, 05:43 PM
  5. [SOLVED] Formula to eperate Street Names from cell containing numbers and other characters
    By rooboyz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2012, 07:17 PM
  6. Replies: 1
    Last Post: 07-13-2006, 04:35 PM
  7. Formula Question:pulls all hours charged
    By Nic in forum Excel General
    Replies: 1
    Last Post: 10-04-2005, 09:05 PM

Tags for this Thread

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