+ Reply to Thread
Results 1 to 5 of 5

Searching for a string in an array of strings

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    Auckland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Searching for a string in an array of strings

    Hi,

    I'm having a little trouble with this one. What I'm trying to do is to use Sheet1 as a reference sheet, then Sheet2 as an order sheet.

    Sheet2 has all the orders, but they are all strings, with the item code in them. What I want to do is extract the code numbers (potentially hundreds of numbers), then compare them against the reference sheet (Sheet1), again potentially hundreds of numbers. The item code may be anywhere in the string.

    What I want returned is the Item name based on the reference sheet.

    So basically:
    1. Get item code from Sheet2
    2. Compare item code in Sheet1
    3. Return item name from Sheet1. Place it in Sheet2

    Is there any way to do this as a formula in a cell?
    Attached Files Attached Files

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Searching for a string in an array of strings

    Is the Item Code always the same 'Size' for example, in your sample it is 1 digit,followed by 1 letter, and separated from the rest by a space...is this consistent ?
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Searching for a string in an array of strings

    Also..is item code always at the end?, if so, it will make solution easier

  4. #4
    Registered User
    Join Date
    04-09-2013
    Location
    Auckland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Searching for a string in an array of strings

    Hi dredwolf,

    No, unfortunately the item code may not always have a space between the item, it is not always at the end of the string as there may be comments after the item code, and it's not consistent in size.

    I've had limited success with the SEARCH function, but all that I got is where in the Order name the Code# is.

    So from Apl 1A, using the search function, I got a 5.

  5. #5
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Searching for a string in an array of strings

    Which is right...the code starts at position 5 in the string, using MID() this could work...the REAL problem is, you have no way to define code size or position, it may not be separated,...Have notes at least got some consistency, so we can get rid of them before we look for the code?...with your sample it is easy, but, from your answer to my question, it's not going to be that simple
    Last edited by dredwolf; 04-10-2013 at 12:41 AM. Reason: spelling correction

+ 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