+ Reply to Thread
Results 1 to 14 of 14

Search string aginst multiple criteria and vlookup to provide value

  1. #1
    Registered User
    Join Date
    06-25-2015
    Location
    usa
    MS-Off Ver
    2014
    Posts
    9

    Search string aginst multiple criteria and vlookup to provide value

    Attached I have a table where I am trying to determine the manufacturer and model number based on the serial number of a device. Thanks to a different thread I have the basics working. However, my vlookup only checks the first 4 characters of a serial number for a match. I have have a rule set that depicts how each serial number can be translated to manufacturer and model. Since each manufacturer uses different syntax for their serial number there can be many options. The one cell where a serial number is input into my sheet must be able to search through multiple sets of criteria. For example, I need to vlookup and match the 1st 4 characters of a serial AND/OR I need to look at the last 2 characters AND/OR look at the first 2 characters....etc (based on all the different types of equipment I have).

    I have a working sheet but as you can see, I am not sure how to add multiple sets of vlookups to account for the various different possible serial numbers. Any advice?

    Asset Detection (1).xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Search string aginst multiple criteria and vlookup to provide value

    Hi

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

    See the file
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

  3. #3
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Search string aginst multiple criteria and vlookup to provide value

    Hi guys,

    That was a really elegant solution from micope21 . I was beavering away on another solution (attached) which involved several hidden "helper columns".

    Asset Detection for smidgen11.xlsx

    I decided to copy micope21's formula into my model, and found I was getting a different result. This was caused by the 12 at the start of the Creston machine. micope21's solution was to change the lookup list on the Series.Rules sheet to 4 characters.

    I am not clever enough to suggest a solution if this is not acceptable, so I attach the way I did it! (Note: I had to ensure that the "Looking for" column was formatted as TEXT.

    I hope this helps, please let me know!

    Regards,

    David

    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

    If several people have responded, when you reply please make it clear WHO you are responding
    to by mentioning their name.

  4. #4
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Search string aginst multiple criteria and vlookup to provide value

    Hi

    David A Coop is correct if 2 characters might not get right word??

    Sample Search you put in 4 characters 5400 and other 2 characters 12?
    You enter 540012DDNA? It will pick up 12 instead 5400? Only way to work without helper which sometime pain in the *** is put in either 3 or more characters, and make sure there nothing match same like ZZ which is 2 characters is fine cos there is no match the same!
    Or
    You can use this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copy down.
    Only problem with this is ZZ with this formula? You can change it to 12A

    See the file

    Regard
    Last edited by micope21; 06-26-2015 at 05:50 AM.

  5. #5
    Registered User
    Join Date
    06-25-2015
    Location
    usa
    MS-Off Ver
    2014
    Posts
    9

    Re: Search string aginst multiple criteria and vlookup to provide value

    This is helpful, I really appreciate it. However, since devices made by Zelda have the same suffix "ZZ", the prefix of their serial numbers will always be unique so I don't think I can use 12A in the Looking for column. Example serial numbers for Zelda devices could be:
    12ABC123ZZ -> works with current method
    5400S239ZZ -> resolves to NEC V802
    11111WK2ZZ -> works in current method
    ...etc

    Is there a way to account for searching both the first 4 characters and\or at the same time look at the last 2 characters?

  6. #6
    Registered User
    Join Date
    06-25-2015
    Location
    usa
    MS-Off Ver
    2014
    Posts
    9

    Re: Search string aginst multiple criteria and vlookup to provide value

    I cant seem to get this lookup to work in Google Sheets although it accepts it. Anyone have experience with Sheet with ideas?

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search string aginst multiple criteria and vlookup to provide value

    Would this work for you?

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


    This compares the first 4 characters in column E with the serial number examples. As long as the first 4 characters match, you will get a result.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Registered User
    Join Date
    06-25-2015
    Location
    usa
    MS-Off Ver
    2014
    Posts
    9

    Re: Search string aginst multiple criteria and vlookup to provide value

    How do I differentiate for the serial number that I know will always begin with 2 characters from a manufacturers and wont know the rest. Also, the serial numbers that I will only ever know the last few charters. Would I need some type of long nested if?

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search string aginst multiple criteria and vlookup to provide value

    From your wording, you would need a table that includes the Manufacturer, the first 2 characters and the ending characters that you indicate that you would know. It would certainly help if we knew what is known for each manufacturer that you would be dealing with.

    You might make a helper column that combines the first 2 characters with the last two characters so that this combination could be used as a lookup for the manufacturer.

  10. #10
    Registered User
    Join Date
    06-25-2015
    Location
    usa
    MS-Off Ver
    2014
    Posts
    9

    Re: Search string aginst multiple criteria and vlookup to provide value

    I have a tab that does specify the serial number rules, however, since different manufacturers have different rulesets I need to account for all senarios. Most manufactures can be determined by their first few characters (some can be identified by the first 4 characters then the rest are completely random, some can be identified by only the first 2 characters and then the rest of the characters are random). The kicker is the manufacturers that can only be identified by the last few characters because their prefixes are the random characters (see Row 14 on Serial.Rules). Im probably going over my head here trying to find a way (maybe it cant be done due to complexity) but I was hoping there was away to account for all scenarios.

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search string aginst multiple criteria and vlookup to provide value

    Relying on the serial numbers to identify a manufacturer may be an exercise in frustration as serial numbers from a manufacturer can be obtained by complex formulae producing what amounts to a "coded message". If you have the data, perhaps using model ID would be more reliable in that the entire code for the model ID could be used to lookup a manufacturer.

    Unless you know how to decode the serial number from each manufacturer, you options are very limited in using that number reliably.

  12. #12
    Registered User
    Join Date
    06-25-2015
    Location
    usa
    MS-Off Ver
    2014
    Posts
    9

    Re: Search string aginst multiple criteria and vlookup to provide value

    Correct, they can be complex. I do however have the rulesets for most of my equipment given to me by manufacturers. For simplicity, I am trying to create an asset detection sheet using prefixes and suffixes.

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Search string aginst multiple criteria and vlookup to provide value

    I don't think that your prefixes and suffixes will work because you don't know when to use the suffix. If you apply suffixes where they don't apply, that will fail. If you don't apply suffixes where they do apply, then that will fail. The same thing applies to the prefixes. I believe that this is a "no win" situation.

  14. #14
    Registered User
    Join Date
    06-25-2015
    Location
    usa
    MS-Off Ver
    2014
    Posts
    9

    Re: Search string aginst multiple criteria and vlookup to provide value

    Could i use some type of nested if that says if no match, try using the suffix, if nothing then definitely no match?

+ 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. multiple criteria search and extraction from string!
    By oasafox in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-28-2014, 07:27 AM
  2. Replies: 1
    Last Post: 04-08-2013, 07:07 PM
  3. Allow Multiple or Single String Search Criteria Macro
    By eurydice88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2009, 02:50 PM
  4. Row count, for multiple criteria, with string search.
    By AshJolie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-20-2009, 02:38 PM
  5. [SOLVED] Search string with multiple criteria
    By fLiPMoD£ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2005, 03:06 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