+ Reply to Thread
Results 1 to 12 of 12

selecting a group of 4 numbers from within a string of 8 by matching to a data base

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    california
    MS-Off Ver
    Excel 2000
    Posts
    7

    selecting a group of 4 numbers from within a string of 8 by matching to a data base

    I have a spreadsheet that has over 2000 items. I need to copy and paste the numbers from one spread sheet to the other or just change the original and save it as the new one, anyway I need to remove letters and some numbers based on the following...
    Each item has a number assigned to it. Item numbers varies in how many digits there are....they are not all eight characters long, but most are. They all have at least 4 numbers that are side by side that I need to reference/keep, some item numbers have letters also that need to be removed....example below. I need to change the item number so that I only have the main first 4 consecutive numbers in the item number that are not a zero unless there are two leading zeros . example 003455 is a jasmin plant that needs to be changed to 0345

    item number.............. item .................................................. new item number
    OR067342 ------------AGAVE DESMETTIANA VARIEGATA -----------6734
    006375 ---------------CAESALPINIA GILLIESII ----------------------0637
    GA09732PT ------------- FERN-ATHYRIUM REGAL RED ----------------9732
    003455 -----------------JASMINUM FLORIDUM ------------------------ 0345
    CA072941 ------------ YUCCA FIL GOLDEN SWORD ------------------7294


    the item doesnt really matter its just to give you an idea of whats going on. I need to change one item number into another with a formula

    each is in a column and individual cells and there are over 2000


    anyone ?
    thanks!!!!!!
    Last edited by markdh; 11-15-2012 at 04:26 AM.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    hi
    does every item that begins with 00 have 3 numbers after, or could there be eg 00VB1234

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    hi
    try this user-defined function

    Please Login or Register  to view this content.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    Are you asking for the integer of the contained number divided by 10?
    Why in that case is 9732 not 973?

    If so try these formulae
    To return a number ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Or, to return a fixed length string ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Marcol; 11-15-2012 at 06:29 AM. Reason: Added Attachment

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    Oops! Just re-read your original post ...

    Try this workbook.
    The helper column can be hidden.
    Use either Column E or F as suits your needs.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  6. #6
    Registered User
    Join Date
    11-15-2012
    Location
    california
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    yes , always

  7. #7
    Registered User
    Join Date
    11-15-2012
    Location
    california
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    must have the leading zero if there are two in the original

  8. #8
    Registered User
    Join Date
    11-15-2012
    Location
    california
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    yes . always and no letters after the zeros....ever....unless attached to the very end of the item number

  9. #9
    Registered User
    Join Date
    11-15-2012
    Location
    california
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    can I call you, Im new at this and dont understand how to apply this....or call me when ever you can
    559-788-2377

  10. #10
    Registered User
    Join Date
    11-15-2012
    Location
    california
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    Im a newby at this and dont understand completely, The spread sheet it will be applied to is a fixed template. Row 1 is taken by tiles, rows 2 through 3000 are item numbers how do I apply the formula you gave me to 3000 rows starting with row 2?
    Are you in scotland? It would be nice if we could chat on the phone about it. or email directly

  11. #11
    Registered User
    Join Date
    11-15-2012
    Location
    california
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    oh wow your in australia........

  12. #12
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: selecting a group of 4 numbers from within a string of 8 by matching to a data base

    Hi markdh
    yes, it's an international forum
    Marcol's formula is probably the easiest way to go
    if you want to try my user-defined formula, but are not sure what to do, try this:

    To copy and use a user-defined formula
    • press alt+F11 to open the VBA area
    • select insert > module
    • copy the code from this website and paste it into the VBA module you just inserted
    • Return to the spreadheet. You now have a new formula that works like the inbuilt formulas such as =SUM()
    • In an empty cell, type:
      =ItemNo(A2)
      or whatever the address to return the item number from

    If you cannot see the developer tab
    • Click the File tab
    • Click Options
    • Click Customize Ribbon
    • Under Customize the Ribbon and under Main Tabs, select the Developer check box

+ 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