+ Reply to Thread
Results 1 to 8 of 8

Matching a Cell with multiple entries

Hybrid View

  1. #1
    Registered User
    Join Date
    10-05-2004
    Location
    Scarborough, ON
    MS-Off Ver
    Mac Office 2019 v16.30 (19101301)
    Posts
    72

    Matching a Cell with multiple entries

    Hi,

    I have this formula:
    =INDEX($A$6:$A$19,MATCH($B$22,H6:H19,0))

    And it finds a Value (ex: G2) in the range H6:H19

    What if the cell has more than 1 value, example cell H8 has the value "G2, G3".

    How can I modify the formula above to find both of them when I alternate the value of B22.

    B22 has a pull-down list: G1, G2, G3, G4
    Regards
    Hemant - Owner
    http://www.hksltd.ca

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Matching a Cell with multiple entries

    Assuming you wan the answer in C22, and down from there:

    =IFERROR(INDEX($A:$A,SMALL(IF(ISNUMBER(SEARCH($B$22,$H$6:$H$19)),ROW($H$6:$H$19)),ROWS(C$22:C22))),"")

    enter as an array formula. Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

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

    Re: Matching a Cell with multiple entries

    Another version. Array entered also.
    Formula: copy to clipboard
    =INDEX($A$6:$A$19,SMALL(IF($B$22=$H$6:$H$19,ROW($A$6:$A$19)-MIN(ROW($A$6:$A$19))+1),ROWS($6:6)))
    Dave

  4. #4
    Registered User
    Join Date
    10-05-2004
    Location
    Scarborough, ON
    MS-Off Ver
    Mac Office 2019 v16.30 (19101301)
    Posts
    72

    Re: Matching a Cell with multiple entries

    Here is the file, I highlighted the cells I am talking about.
    Attached Files Attached Files

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,725

    Re: Matching a Cell with multiple entries

    Try entering this in B24 and fill down.
    Formula: copy to clipboard
    =INDEX($A$6:$A$19,MATCH(1,MMULT(ISNUMBER(FIND($B$22,$B$6:$K$19))*($A24=$B$5:$K$5),{1;1;1;1;1;1;1;1;1;1}),0))

  6. #6
    Registered User
    Join Date
    10-05-2004
    Location
    Scarborough, ON
    MS-Off Ver
    Mac Office 2019 v16.30 (19101301)
    Posts
    72

    Re: Matching a Cell with multiple entries

    Quote Originally Posted by FlameRetired View Post
    Try entering this in B24 and fill down.
    Formula: copy to clipboard
    =INDEX($A$6:$A$19,MATCH(1,MMULT(ISNUMBER(FIND($B$22,$B$6:$K$19))*($A24=$B$5:$K$5),{1;1;1;1;1;1;1;1;1;1}),0))
    THIS WORKS PERFECTLY!!!!!!

    just had to say it like that

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Matching a Cell with multiple entries

    Or indeed this (a bit slow tonight), in B24, copied down:

    =INDEX(A:A,SUMPRODUCT((ISNUMBER(SEARCH($B$22,$B$6:$L$20))*($B$5:$L$5=A24)*ROW($B$6:$L$20))))

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,725

    Re: Matching a Cell with multiple entries

    Glad to hear it! Thanks for the feedback.

+ 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. Replies: 1
    Last Post: 09-23-2015, 02:28 PM
  2. Replies: 6
    Last Post: 06-11-2013, 02:28 AM
  3. Auto fill out exact matching data for multiple entries from another sheet
    By ryan4646 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-10-2013, 07:05 AM
  4. [SOLVED] Automatically add multiple original field entries total (that has multiple entries)
    By steverokh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2013, 01:20 AM
  5. Splitting multiple entries in single cell into multiple columns
    By David_Mitchell in forum Excel General
    Replies: 12
    Last Post: 01-24-2013, 06:57 AM
  6. VBA macro needed to delete duplicate entries matching across multiple columns
    By chicolocal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2012, 02:34 PM
  7. Replies: 10
    Last Post: 04-09-2010, 10:50 AM

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