+ Reply to Thread
Results 1 to 9 of 9

Extract names from a list that have a certain value

  1. #1
    Forum Contributor
    Join Date
    11-03-2012
    Location
    Nottingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Extract names from a list that have a certain value

    Hi. I have a list of names, each with 6 numbers associated with their name.

    I wish to enter a number (into I4 and Excel return all names in the list that have that number, into J:, K:, L: and soon. Or, if easier, all names into just J:
    Most numbers will have more than one name.

    I'm sure this is easy, but I'm a real novice with Excel and looking to improve with online courses!

    Many thanks for any help.

  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,893

    Re: Extract names from a list that have a certain value

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


    To run the Excel VBA code:
    • Press Alt-F8 to open the macro list
    • Select a macro in the list
    • 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 Contributor
    Join Date
    11-03-2012
    Location
    Nottingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Extract names from a list that have a certain value

    Thank you for the quick reponse, Alan. But surely there must be a fairly easy way in Excel using functions and formula - I really don't want to be using VBA if I can avoid it (I know even less about that than Excel )

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Extract names from a list that have a certain value

    Formula solution:
    In J4:
    Please Login or Register  to view this content.
    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Quang PT

  5. #5
    Forum Contributor
    Join Date
    11-03-2012
    Location
    Nottingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Extract names from a list that have a certain value

    Thank you Bebo. I'm afraid that doesn't work.

    I wish to enter a number, if any name in the list has that number in their list, I want Excel to return the name(s).

    For example, if I was to enter 23, Excel should return Alex, Amy, Dave W

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Extract names from a list that have a certain value

    It works - it does what you said you wanted:

    Excel 2016 (Windows) 32 bit
    I
    J
    K
    L
    3
    Number
    Names
    4
    3
    Amy Dave Kelly Dave Kelly Mary
    5
    6
    Alex Dave Kelly Diane Dave Kelly Mary
    6
    11
    Alex Autar Dave W
    Sheet: Sheet1

    Did you remember to drag copy it across and down???

    Excel 2016 (Windows) 32 bit
    I
    J
    K
    L
    M
    3
    Number
    Names
    4
    23
    Alex Amy Dave Kelly Diane Dave W
    5
    6
    Alex Dave Kelly Diane Dave Kelly Mary
    6
    11
    Alex Autar Dave W
    Sheet: Sheet1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Contributor
    Join Date
    11-03-2012
    Location
    Nottingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Extract names from a list that have a certain value

    Sorry! I must be missing someting here I have copied the formula that Bebo suggested into J4. I understand what an array formula is.

    But if I enter a value to test, surely the formula is overwritten?

    Forgive me, but as I say, my Excel knowledge is novice to dsay the best.

    Ali - what you have attached is exactly what I am after. Thank you.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Extract names from a list that have a certain value

    You shouldn't need to enter it as an array formula as you have Office 365.The formula goes into J4 and is copied across to the right and down. Test values go into column I, not column J.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    11-03-2012
    Location
    Nottingham, UK
    MS-Off Ver
    Office 365
    Posts
    127

    Re: Extract names from a list that have a certain value

    Of course! Thank you both again, very much indeed. I'll mark thread as solved

+ 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. Extract list of Names to display only once
    By sirdon in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 18
    Last Post: 10-28-2019, 05:13 PM
  2. Extract list of Names to display only once
    By sirdon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-21-2019, 06:26 PM
  3. [SOLVED] Extract names from list only once
    By Immortal2014 in forum Excel General
    Replies: 7
    Last Post: 09-26-2017, 03:13 PM
  4. [SOLVED] Extract first and last names from a list of names
    By Macfool in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-12-2017, 06:44 AM
  5. Need a formula to extract names from a master list
    By Anies in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-12-2014, 02:24 PM
  6. [SOLVED] How to extract text from a list of names
    By busygurl in forum Excel General
    Replies: 3
    Last Post: 09-10-2013, 02:51 AM
  7. Extract client names from the list - vba
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-29-2011, 05:39 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