+ Reply to Thread
Results 1 to 4 of 4

Sort table B by Table A's IDs

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    Greater NYC Area
    MS-Off Ver
    Excel 2010
    Posts
    84

    Sort table B by Table A's IDs

    Hello

    Simple question for you. I have two tables - Table A and Table B. Table A has just a few entries in it while Table B has a much larger data set (including all of the entries in Table A). I want to filter Table B to just show me the rows that match Table A's items. What is the best way to go about doing this?

    This is a dumbed down version of an exercise I need to do. A VLOOKUP or any kind of searching won't work. I need to filter Table B in place.

    I've actually found a way to do this by using the advanced filter, but since in my data set Table A has 350 rows and Table B has 5,000+ rows it's just a little inconvenient to add a ton of rows above Table B and advanced filter that way.

    See attached for example

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,295

    Re: Sort table B by Table A's IDs

    Yep,

    Advanced Filters is the method I'd use. Instead of filtering in place, why don't you try to filter the answer to another range of cells (to the right of your tables). You might even look at Dynamic Named Ranges for your two tables to make the problem easier when the number of rows grows for either table.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Sort table B by Table A's IDs

    Hi IronCladRooster

    This Code is in the attached and appears to do mostly what you describe...CTRL + x will fire the Code.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jaslake; 04-09-2016 at 03:53 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Sort table B by Table A's IDs

    You could add a column to Table B and filter for TRUE:

    Row\Col
    J
    K
    L
    M
    N
    8
    ID Important piece of information Formula
    9
    6
    $97,756
    #N/A
    L9: =LOOKUP([@ID], TableA[ID])=[@ID]
    10
    9
    $51,310
    #N/A
    11
    13
    $84,290
    #N/A
    12
    14
    $95,457
    #N/A
    13
    14
    $61,379
    #N/A
    14
    18
    $66,909
    #N/A
    15
    19
    $75,238
    TRUE
    16
    21
    $55,824
    FALSE
    17
    22
    $61,068
    FALSE
    18
    24
    $90,160
    FALSE
    19
    27
    $63,494
    TRUE
    20
    31
    $68,747
    FALSE
    21
    34
    $59,831
    FALSE
    22
    44
    $56,027
    TRUE
    23
    49
    $93,621
    FALSE
    24
    50
    $69,122
    FALSE
    25
    54
    $57,409
    FALSE
    26
    61
    $63,600
    FALSE
    27
    67
    $83,192
    FALSE
    28
    77
    $65,791
    FALSE
    29
    82
    $52,434
    FALSE
    Last edited by shg; 04-10-2016 at 12:57 PM.
    Entia non sunt multiplicanda sine necessitate

+ 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. [SOLVED] Sort volumes from a random table to a new Table.
    By omega0010 in forum Excel General
    Replies: 8
    Last Post: 08-15-2014, 04:29 PM
  2. [SOLVED] Look at column in table, remove duplicates and sort to another table
    By pdx-adm-trm01 in forum Excel General
    Replies: 1
    Last Post: 03-19-2014, 06:56 PM
  3. Re-sort table without affecting original table?
    By jfrog in forum Excel General
    Replies: 1
    Last Post: 01-30-2013, 01:19 PM
  4. [SOLVED] Need a formula to sort a table into table (for a Table Plan) and name in column 2
    By jbpianoman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2012, 09:21 AM
  5. Sort table with only formulas...and not pivot table
    By agweyre in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-31-2012, 09:19 PM
  6. Replies: 2
    Last Post: 05-19-2010, 05:14 AM
  7. [SOLVED] pivot table sort entries that don't yet appear in table
    By rachael in forum Excel General
    Replies: 11
    Last Post: 09-19-2005, 07:05 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