+ Reply to Thread
Results 1 to 8 of 8

Making a condensed table (details inside)

  1. #1
    Registered User
    Join Date
    09-17-2019
    Location
    Toronto, ON
    MS-Off Ver
    Office 2019
    Posts
    3

    Making a condensed table (details inside)

    One table in Excel (let's call it Table A) lists of the largest 200 US cities. In another table (let's call it Table B), I have data of thousands of US cities and most cities are mentioned multiple times, and in some cases close to 30 times. Both tables, the city name is in a column. Table A has US city names in column B and Table B as US city names in column E. I would like to create a condensed table which takes Table B as a starting point and includes only the top 200 US cities and omits everything else. For added clarity, let's take NYC for an example. There are about 25 rows that mention NYC. I would like this query to see NYC in Table A and know that it should search the entire Table B and pull every row that includes NYC in the condensed table. It doesn't matter of this condensed table is in a new tab or not.

    Thanks so much in advance

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Making a condensed table (details inside)

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-17-2019
    Location
    Toronto, ON
    MS-Off Ver
    Office 2019
    Posts
    3

    Re: Making a condensed table (details inside)

    Thank you, PMFDibbins! I attached a file with sample data.

    The attached file includes three tables. The first two tables are similar to the ones I'm working with.

    The third table is what I'd like to get

    Just to make clear - I like to look at the cities listed in Table 1 and search for all matches in Table 2.
    It's common for multiple matches to occur for each city listed in Table 1.

    The for each match, copy the entire row and paste it in the Output table. In the case of New York City, there are
    multiple matches. Instead of just pasting the row where the first match exists, copy and paste all mentions of NYC to create a table.

    Then it does the same for Los Angeles. It is possible for there to be no matches for a few cities listed in Table 1.

    The main difference is that Table 2 is about 8 or 9 columns wide and probably about 10k-20k rows.

    Please ask if you need clarity. Thanks a bunch!
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Making a condensed table (details inside)

    You could add this formula to D3:

    =IFERROR(INDEX(A:A,MATCH(E3,B:B,0)),"")

    then copy it down to the bottom of Table 2. It will fill in the appropriate rank from column A. Then you can fix those formulae to values using Copy | Paste Special | Values | OK | Esc. Then you can sort Table 2 (including those ranks) using the new rank column as the sort field.

    Hope this helps.

    Pete

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,221

    Re: Making a condensed table (details inside)

    As per your upload...
    Tables are ranges and not a actual listobjects
    Please Login or Register  to view this content.


    EDIT...Just noticed you only want first 200 logged....
    Last edited by sintek; 09-20-2019 at 09:35 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Registered User
    Join Date
    09-17-2019
    Location
    Toronto, ON
    MS-Off Ver
    Office 2019
    Posts
    3

    Re: Making a condensed table (details inside)

    Thanks so much guys

    Stupid question, how do I open up VBA editor? I don't think I've done this is some 10 years. I tried Alt & F11, but it opens up another worksheet. I figure I ask.

    Thanks again.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Making a condensed table (details inside)

    ALT LV should do it for you

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Making a condensed table (details inside)

    Quote Originally Posted by unwind View Post
    The main difference is that Table 2 is about 8 or 9 columns wide and probably about 10k-20k rows.
    Try
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 09-21-2019 at 12:23 AM. Reason: File attached

+ 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] [VBA - Help] Offset/Move Value - Details Inside...
    By timdecker in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-28-2016, 02:37 PM
  2. Need help writing macro to input data in Different row each day: details inside
    By Pimp_mentality in forum Excel Programming / VBA / Macros
    Replies: 51
    Last Post: 10-21-2015, 03:34 PM
  3. [SOLVED] Need to get counts by date for 2 columns (more details inside)
    By excelbrah in forum Excel General
    Replies: 9
    Last Post: 03-01-2015, 08:50 PM
  4. Replies: 12
    Last Post: 11-02-2014, 12:55 PM
  5. Randomly Select Worker Based On Eligibility (see details inside)
    By levitt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2014, 03:11 PM
  6. Replies: 15
    Last Post: 07-15-2012, 02:27 PM
  7. Creating Dynamic Database to Webpage - Details Inside
    By cjm2010 in forum Excel General
    Replies: 0
    Last Post: 02-20-2012, 03:38 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