+ Reply to Thread
Results 1 to 10 of 10

Lookup and match a number to a start and end sequence column

Hybrid View

  1. #1
    Registered User
    Join Date
    10-25-2023
    Location
    London
    MS-Off Ver
    365
    Posts
    5

    Post Lookup and match a number to a start and end sequence column

    Hi Everyone,

    I have been working on solving a problem in Excel for a couple of days and wondered if there was a quicker method to achieve the below? I have tried index and match but cannot use autofill to drag down to the rest of the values I need to check. Not sure if PowerQuery would solve this.

    I have a worksheet with 2 columns: Start Sequence, and End Sequence, for instance B2 and B3 (see attached example).
    In the second worksheet I have a column named: Sequence Ref with over 9000 sequence reference numbers, for example A1 (see attached example).

    There are over 9000 records in each workbook (example contains 20 records).

    I want Excel to lookup each value in the Sequence Ref column and match it to the relevant Start Sequence and End Sequence columns to see if it falls within the sequence range. Once matched it must either indicate the row number the sequence falls in (or any other method to indicate to the user that the match was found in the relevant start and end constraint).

    If it is not found it can return "not found" or leave the answer blank.

    I can use the IF, index, match etc but when dragging down the column to return the result for all sequence refs, it does not work.

    Hoping someone can guide me or tell me it is not possible?

    Many thanks.
    Attached Files Attached Files
    Last edited by foulkesatwork; 10-25-2023 at 10:40 AM. Reason: Uploading example

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,324

    Re: Lookup and match a number to a start and end sequence column

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-25-2023
    Location
    London
    MS-Off Ver
    365
    Posts
    5

    Re: Lookup and match a number to a start and end sequence column

    Thanks AliGW, I have uploaded an example workbook.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,324

    Re: Lookup and match a number to a start and end sequence column

    Is this it?

    In B2 copied down:

    =XLOOKUP(A2,Sheet1!$B$2:$B$20,Sheet1!$A$2:$A$20,"Not Found",-1)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-25-2023
    Location
    London
    MS-Off Ver
    365
    Posts
    5

    Re: Lookup and match a number to a start and end sequence column

    Hi AliGW, yes thats exactly what I wanted to achieve - thank you soooo much! Should of thought of good old xlookup! Brilliant and thanks again for such a quick solution.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,324

    Re: Lookup and match a number to a start and end sequence column

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  7. #7
    Registered User
    Join Date
    10-25-2023
    Location
    London
    MS-Off Ver
    365
    Posts
    5

    Re: Lookup and match a number to a start and end sequence column

    Hi AliGW, have just applied to my work spreadsheet and the formula works for the first argument, but when copying down the column to match the rest of the Storage reference numbers it duplicates the same answer all the way down the column, which is incorrect.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,324

    Re: Lookup and match a number to a start and end sequence column

    Provide a workbook that shows the problem.

  9. #9
    Registered User
    Join Date
    10-25-2023
    Location
    London
    MS-Off Ver
    365
    Posts
    5

    Re: Lookup and match a number to a start and end sequence column

    Hi AliGW thanks, I have solved the problem now. Will mark as solved.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,324

    Re: Lookup and match a number to a start and end sequence column

    Please share the solution - don't just leave the thread hanging!

+ 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. Lookup row number to match column and calculated value
    By gaiusA in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-10-2021, 11:12 PM
  2. Formula to lookup numerous columns and add the next number in sequence
    By jenn_t in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-01-2021, 11:38 PM
  3. [SOLVED] Using MATCH to find row number based on a two-column lookup.
    By systemlordanubis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2016, 08:34 AM
  4. [SOLVED] VBA to count number in column and give number sequence in next column
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2016, 09:38 AM
  5. Replies: 7
    Last Post: 06-08-2015, 08:39 AM
  6. [SOLVED] Formula to display sequence number based on contiguous start and end dates
    By AlanCake in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-04-2013, 07:37 AM
  7. [SOLVED] How can I match a random number with closest number from sequence?
    By matt in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2006, 08:25 PM

Tags for this Thread

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