+ Reply to Thread
Results 1 to 3 of 3

Formula to return entire row if certain cell values are true/exact

  1. #1
    Registered User
    Join Date
    01-31-2017
    Location
    Los Angeles
    MS-Off Ver
    365
    Posts
    9

    Formula to return entire row if certain cell values are true/exact

    Hello, Forum. On the info below (also attached) I'd like to search for 2 of the countries that exist in C and return only those rows in a new tab. I played with VLOOKUP but I'm not savvy enough to remove the N/As or get the entire row instead of one column. Any help is appreciated!

    Name ID Country
    Smith 12345 US
    Jones 54321 CA
    Johnson 34512 DE
    Harris 21543 UK
    Knight 54312 US

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: Formula to return entire row if certain cell values are true/exact

    Here is a VBA solution/Run it once for each country you select

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Formula to return entire row if certain cell values are true/exact

    Another way.

    Apply the second range in a new tab.

    With target countries in E1:F1 array enter this formula in E2, fill down and across until you get blanks. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    E
    F
    G
    1
    Name
    ID
    Country
    DE
    US
    2
    Smith
    12345
    US
    Smith
    12345
    US
    3
    Jones
    54321
    CA
    Johnson
    34512
    DE
    4
    Johnson
    34512
    DE
    Knight
    54312
    US
    5
    Harris
    21543
    UK
    6
    Knight
    54312
    US
    Dave

+ 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] Finding a specific text string throughout an entire column and if there return true/false
    By myfivemonkeys in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-06-2015, 07:31 PM
  2. [SOLVED] Index Match formula with Or Exact True/False output
    By Karroog in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-10-2014, 02:32 PM
  3. Compare a1 with entire column and return TRUE in b1
    By yiannis1925 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-12-2011, 01:08 PM
  4. Simple formula to return true if cell contains no data
    By Pyrex238 in forum Excel General
    Replies: 2
    Last Post: 11-17-2011, 11:46 AM
  5. Replies: 2
    Last Post: 02-17-2011, 10:15 PM
  6. Return True/False if cell contains formula
    By rziegler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-09-2009, 03:03 PM
  7. [SOLVED] formula to return the value of a cell based on a looked up true reference
    By sarah in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-02-2005, 05:06 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