Forum Discussion

cr9926's avatar
cr9926
Copper Contributor
Oct 25, 2023
Solved

Filtering cells onto a new sheet based on values in a column

I'm not sure how to use VLookup or Index to achieve this. I have a sheet that contains multiple columns of data. From that I want to create a second sheet that returns values from only two columns based on a third column. Eg. Sheet one has a list of customer data, on sheet two I would like it to only return values from columns C (Name) and E (Number) if column A contains "USA", without having blank rows where the Country column contains something other than USA.

 

Sheet 1:      Sheet 2: 
ABCDE  AB
CountryColorNameAmountNumber  NameNumber
USABlueCats Inc.2111222  Cats Inc.111222
CanadaGreenDogs Ltd.5444555  Giraffe Corp335544
UKRedTurtle Inc.3666777  Zebra Inc.775566
UKYellowFrog LLC7888999  Lions Ltd.994422
CanadaPinkBirds Corp1221133    
USAPurpleGiraffe Corp9335544    
USABlack Zebra Inc.3775566    
USAWhite Lions Ltd.2994422    
CanadaGreyFish LLC1441122    

  • To achieve this in Excel, you can utilize the FILTER function if you're using a version of Excel that supports it (like Microsoft 365 or Excel 2019 and later). Here's how you can do it:

    On Sheet2:

    In cell A1, enter the formula:
    =FILTER(Sheet1!C:C, Sheet1!A:A="USA")
    In cell B1, enter the formula:
    =FILTER(Sheet1!E:E, Sheet1!A:A="USA")
    These formulas will populate columns A and B on Sheet2 with the names and numbers from Sheet1 where the country is "USA".

4 Replies

Resources