+ Reply to Thread
Results 1 to 2 of 2

Need to return just the part number in the middle of a string

  1. #1
    Registered User
    Join Date
    12-28-2018
    Location
    Pennsylvania, US
    MS-Off Ver
    Excel 2016-Windows 10
    Posts
    35

    Need to return just the part number in the middle of a string

    A customer sent a list of parts he wants quoted. The problem is the list he sent has the part number(which is what I need to do the lookup) in the middle of the cell. The general format of the cells are "blah blah blah description 8366379 COMPANY NAME." I need only the 8366379. The problem is that there are a lot of variations to that format. Sometimes the part number is 5 characters long, other times its 10. Sometimes the part number starts with a letter instead of a number. The length of the description is also always changing.

    The only constant is that the part number is the 3rd to last word in the description. Is there a way to pull only the 3rd to last phrase out even though the length of that word and where it starts in the string often changes?

    Thanks for any help

    Edit: I've added a sample file
    Attached Files Attached Files
    Last edited by chough10; 02-12-2020 at 12:39 PM.

  2. #2
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Need to return just the part number in the middle of a string

    Hello,

    Look at sheet 2. I used a formula to get the last 3:

    =IF((LEN(A3)-LEN(SUBSTITUTE(A3," ","")))<3, A3, RIGHT(A3,LEN(A3)-FIND("/", SUBSTITUTE(A3," ","/", (LEN(A3)-LEN(SUBSTITUTE(A3," ",""))-2)))))

    Then copied the values to another column. Finally data text to columns to separate them into 3 columns.

    I hope this helps

+ 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: 6
    Last Post: 03-11-2019, 05:06 AM
  2. [SOLVED] Return the first part of a string up to the first number
    By hvincent in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-24-2014, 07:57 PM
  3. [SOLVED] How Do I Find and Return a String When Only Part of that String is Known?
    By Foamy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-08-2014, 05:31 AM
  4. [SOLVED] Number need to inserted in the middle of text string in cell in one column
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-28-2014, 04:51 AM
  5. [SOLVED] formula to pick out text in middle of string and return
    By Burt_100 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-24-2014, 05:32 PM
  6. [SOLVED] search for a "part number" within a string and return its cell position or contents of cel
    By benakil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-24-2013, 06:37 AM
  7. delete middle part of text string
    By maacmaac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2009, 03:59 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