+ Reply to Thread
Results 1 to 7 of 7

Consecutive cells match a defined sequence then vlookup

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    30

    Consecutive cells match a defined sequence then vlookup

    Hi!

    I am looking for a code, which should compare in column A if there is a specific defined sequence, which is given in the column E (two sequences). When this sequence is found, then the code should lookup the value in column B from the first and last letter of the sequence and write these values in the format "Value 1 - Value 2" in column H, when it is the data for George, otherwise in column I, when it is the data for Peter.

    There are several sequences in the data for George and Peter. Therefore the code should write a first entry and then also the second entry in the next row. I hope I explained it reasonable. The sheet is attached. Thanks a lot guys!
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Consecutive cells match a defined sequence then vlookup

    Hi IndigoSK,
    try this
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-09-2015
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    30

    Re: Consecutive cells match a defined sequence then vlookup

    Thanks nilem. Thatīs ist. Very nice!

    I am struggling a litte bit with understanding the code. When I am adding a new sequence under the data of George or Peter, what do I have to change, that there is a new, a third line in the results column. Thanks!

  4. #4
    Registered User
    Join Date
    02-09-2015
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    30

    Re: Consecutive cells match a defined sequence then vlookup

    Thanks nilem. Thatīs it. Very nice!

    I am struggling a litte bit with understanding the code. When I am adding a new sequence under the data of George or Peter, what do I have to change, that there is a new, a third line in the results column. Thanks!

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Consecutive cells match a defined sequence then vlookup

    you need to create a named range, such as "John"
    In this case, the code looks like
    Please Login or Register  to view this content.
    and override the resulting array
    Please Login or Register  to view this content.
    Of course, other approaches and solutions are possible.

  6. #6
    Forum Contributor
    Join Date
    07-11-2012
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    144

    Re: Consecutive cells match a defined sequence then vlookup

    Hi IndigoSK,
    try this function which has Sequence as what type of sequence you want and range as

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-09-2015
    Location
    Germany
    MS-Off Ver
    2013
    Posts
    30

    Re: Consecutive cells match a defined sequence then vlookup

    Hi fshbet,

    I didnīt get your code to work. Donīt know whatīs the problem. But thanks a lot. The code from nilem works fine. Thank you your explanation too.

+ 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. Rolling ID of rows in a consecutive sequence with multiple IFs?
    By JuliaK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2015, 02:29 PM
  2. [SOLVED] Consecutive number sequence
    By BEEGINA in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-14-2014, 10:55 PM
  3. Replies: 1
    Last Post: 07-11-2014, 03:59 PM
  4. Serial number creation / pre-defined alphanumeric sequence / formula
    By beano129 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-08-2012, 02:27 AM
  5. Replies: 4
    Last Post: 03-04-2010, 11:53 AM

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