Forum Discussion

tw1211's avatar
tw1211
Copper Contributor
Sep 26, 2023
Solved

Extract data using a second list

Hello,    I am newbie with Excel and I have been struggling with this problem.    I have a first table with multiple variables in line B-E all describing different aspects of line A.  In line G,...
  • LeonPavesic's avatar
    Sep 26, 2023

    Hi tw1211,

    Use the FILTER function.

    The FILTER function allows you to filter a table based on a set of criteria. To use the FILTER function to extract data using a second list, follow these steps:

    1. Create a new column next to your second list and call it "Match".
    2. In cell H2, enter the following formula:

     

    =FILTER(A:E, A:A=G2)​

     

    This formula will return all of the rows from the first table (columns A:E) where the value in column A matches the value in cell G2.

    1. Copy the formula down to the rest of the cells in column H.

    2. Select the entire column H and copy it.

    3. Paste the copied data into a new worksheet.

    This will create a new worksheet with only the data from the first table that has a corresponding value in the second list.

     

    Here is an example:

    First table:
    
    A | B | C | D | E
    -- | -- | -- | -- | --
    Product 1 | Price | Quantity | Color | Weight
    Product 2 | Price | Quantity | Color | Weight
    Product 3 | Price | Quantity | Color | Weight
    Product 4 | Price | Quantity | Color | Weight
    Product 5 | Price | Quantity | Color | Weight
    
    Second list:
    
    G
    --
    Product 1
    Product 3

     

    1. Create a new column next to the second list (column G) and call it "Match".
    2. In cell H2, enter the following formula:

     

    =FILTER(A:E, A:A=G2)​

     

    1. Copy the formula down to the rest of the cells in column H.

    2. Select the entire column H and copy it.

    3. Paste the copied data into a new worksheet.

    The new worksheet will contain the following data:

    A | B | C | D | E
    -- | -- | -- | -- | --
    Product 1 | Price | Quantity | Color | Weight
    Product 3 | Price | Quantity | Color | Weight

     

    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic (LinkedIn)

Resources