+ Reply to Thread
Results 1 to 9 of 9

Formula to find and match multiple values

  1. #1
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Formula to find and match multiple values

    Hi Gurus,

    Would need your kind expertise to help on this request.

    Assuming I’ve the following sample data as per attached and wishing if the expected output can be generated using some kind of excel/vba formulas.

    The requirement is to find and match the specific cell which contains multiple values and return them in horizontal layout.

    The sample data could be long and a lot, so it's best if the formula can be made flexible to cater for this situation.

    Appreciate for any of your help and advice.

    Thank you a lot in advance.
    Attached Files Attached Files
    Regards,
    Jack

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Formula to find and match multiple values

    Insert a new column C, then you can use these formulae in the cells stated:

    C2: =IF(COUNTIF(A$2:A2,A2)=1,MAX(C$1:C1)+1,"-")

    D2: =IFERROR(VLOOKUP(A2,A:C,3,0)&"_"&COUNTIF(A$2:A2,A2),"")

    Copy these down as far as you need.

    Then with the headers for your secondary table in E1, F1, G1 etc., You can use this formula in E2 to get the unique list of names:

    =IFERROR(INDEX($A:$A,MATCH(ROWS($1:1),$C:$C,0)),"")

    Copy down as far as you need to (until you start to get blanks), then put this formula in F2:

    =IFERROR(INDEX($B:$B,MATCH(ROWS($1:1)&"_"&COLUMNS($F:F),$D:$D,0)),"")

    This can be copied across and down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Formula to find and match multiple values

    another alternative, using your sample file:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Formula to find and match multiple values

    Hi Gurus,

    Thanks so much for your help.

    It worked as expected.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Formula to find and match multiple values

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  6. #6
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Formula to find and match multiple values

    Hi Gurus,

    Have some additional requests.

    Will it be possible to have the script/formula to check and merge any of multiple entries and produce the following output, see attached file?

    Thanks again.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Formula to find and match multiple values

    Hi Pete,

    Noted, I'll close it once it's finalized.

    FYI, I've already done so to thanks those Gurus who have helped me

    Thanks.

  8. #8
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Formula to find and match multiple values

    Probably warranted a new thread (for future ref.) but using your sample file:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    pending size of your real life datasets the above isn't going to be particularly efficient, however.

  9. #9
    Forum Contributor
    Join Date
    12-30-2006
    Location
    Australia
    MS-Off Ver
    2017
    Posts
    151

    Re: Formula to find and match multiple values

    Hi XLen,

    Great, thanks for your help.

    Also, noted on your feedback, will create a new thread next time.

    Have a nice day.

+ 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. vlookup does not find match if there are multiple values in cell
    By mcarrio in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-03-2018, 02:12 PM
  2. [SOLVED] formula to find date,match name and sum values
    By andy_tap in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-17-2016, 07:48 AM
  3. Replies: 5
    Last Post: 02-09-2015, 01:54 PM
  4. [SOLVED] VLOOKUP match multiple values to return one value + find min price
    By asgb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2012, 12:02 AM
  5. Find a match from a cell that has multiple values?
    By rjos4 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-18-2011, 05:47 PM
  6. [SOLVED] find multiple occurances of a value and match to values in another
    By carl43m in forum Excel General
    Replies: 1
    Last Post: 08-16-2006, 06:10 PM
  7. [SOLVED] Sum values in multiple sheets using Lookup to find a text match
    By CheriT63 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-03-2005, 10:35 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