+ Reply to Thread
Results 1 to 6 of 6

index, match, concatenate issue

  1. #1
    Registered User
    Join Date
    10-27-2015
    Location
    Ottawa
    MS-Off Ver
    7
    Posts
    4

    index, match, concatenate issue

    Hi,
    I have groups of Students and Mentors and using index match I have been able to isolate the names of the mentors next to the students by group. In some instances, their may be two mentors in a group but I am unable to concatenate the two mentor's first and last names. Here is the formula I am currently using to acquire the mentor's name next to the students in the appropriate group. {=IF(D3="Mentor","",INDEX($B$2:$B$8&", "&$C$2:$C$8,MATCH(A3,IF($D$2:$D$8="Mentor",$A$2:$A$8),0)))} As you can see on the attached Excel worksheet(Mentor Test), it only picks up the first mentor not the second mentor. What I would like to see is the two mentors within the same group show up next to the students within that group (See Mentor Results as an example of what I would like to see). Can any of you GURUS help me in my dilemma.
    Attached Files Attached Files

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: index, match, concatenate issue

    Not sure, do you really want a macro? What about a formula?
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: index, match, concatenate issue

    this formula in cell G2 will do the job as long as there is no more than 2 mentors.
    Please Login or Register  to view this content.
    This is an array formula. It means you have the end its editing by CTRL+SHIFT+ENTER at the same time.

  4. #4
    Registered User
    Join Date
    10-27-2015
    Location
    Ottawa
    MS-Off Ver
    7
    Posts
    4

    Re: index, match, concatenate issue

    OMG, it works great. Thank you so much for resolving my dilemma. The only thing now was to remove the mentor's name next to their own name. So I added an if statement to your formula as follows and it worked great. Thank you, I greatly appreciate your help.
    =IF(D2="Mentor","",IF(COUNT(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8),""),""))=1,INDEX($C$2:$C$8&", "&$B$2:$B$8,SMALL(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8)-1,""),""),1)),INDEX($C$2:$C$8&", "&$B$2:$B$8,SMALL(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8)-1,""),""),1))&" and "&INDEX($C$2:$C$8&", "&$B$2:$B$8,LARGE(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8)-1,""),""),1))))

  5. #5
    Registered User
    Join Date
    10-27-2015
    Location
    Ottawa
    MS-Off Ver
    7
    Posts
    4

    Re: index, match, concatenate issue

    OMG, it works great. Thank you so much for resolving my dilemma. The only thing now was to remove the mentor's name next to their own name. So I added an if statement to your formula as follows and it worked great. Thank you, I greatly appreciate your help.
    =IF(D2="Mentor","",IF(COUNT(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8),""),""))=1,INDEX($C$2:$C$8&", "&$B$2:$B$8,SMALL(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8)-1,""),""),1)),INDEX($C$2:$C$8&", "&$B$2:$B$8,SMALL(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8)-1,""),""),1))&" and "&INDEX($C$2:$C$8&", "&$B$2:$B$8,LARGE(IF($A$2:$A$8=A2,IF($D$2:$D$8="Mentor",ROW($D$2:$D$8)-1,""),""),1))))

  6. #6
    Registered User
    Join Date
    10-27-2015
    Location
    Ottawa
    MS-Off Ver
    7
    Posts
    4

    Re: index, match, concatenate issue

    Oop, I did a newbie mistake, posted twice. Just as a final entry after testing it on my big document I encountered some issue which I was able to resolve. I posted a small file for information and testing purposes, however, my file had 1000 rows, so I had to adjust it to accomodate the large number of rows making it more dynamic. Here is the result of my modifications for any user wishing to use this formula.
    {=IF(D2="Mentor","",IF(COUNT(IF($A$2:$A$1000=A2,IF($D$2:$D$1000="Mentor",ROW($D$2:$D2),""),""))=1,INDEX($B$2:$B$1000&", "&$C$2:$C$1000,SMALL(IF($A$2:$A$1000=A2,IF($D$2:$D$1000="Mentor",ROW($D$2:$D2)-1,""),""),1)),INDEX($B$2:$B$1000&", "&$C$2:$C$1000,SMALL(IF($A$2:$A$1000=A2,IF($D$2:$D$1000="Mentor",ROW($D$2:$D2)-1,""),""),1))&" and "&INDEX($B$2:$B$1000&", "&$C$2:$C$1000,LARGE(IF($A$2:$A$1000=A2,IF($D$2:$D$1000="Mentor",ROW($D$2:$D2)-1,""),""),1))))} Thanks again p24leclerc for the formula, amazing work.

+ 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. Match Index and Concatenate Formula
    By kharding15 in forum Excel General
    Replies: 4
    Last Post: 10-02-2015, 09:01 PM
  2. Match Index, Small Index with Concatenate
    By kharding15 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-30-2015, 05:38 PM
  3. [SOLVED] Match Issue - Consolidate Columns of Data With Match/Index/etc?
    By excelsior123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2014, 05:14 PM
  4. Help Using Concatenate with Index Match
    By billyshears in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-25-2013, 10:09 AM
  5. [SOLVED] Index, Match and Concatenate
    By mmayna03 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2012, 09:55 PM
  6. [SOLVED] INDEX-MATCH w/ CONCATENATE
    By zamgold in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-25-2012, 11:08 AM
  7. [SOLVED] Index/Match or sumproduct with concatenate
    By pauldaddyadams in forum Excel General
    Replies: 14
    Last Post: 04-18-2012, 12:30 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