[FORMULA] Return String Value of Multiple Cells In One Cell

xTwisteDx

New Member
Joined
Jul 18, 2018
Messages
4
I have a batch of data in the following format.

This is my input:

GROUPEMPLOYEE
someEmail1@here.comJane Doe
someOtherEmail@there.comJohnny Lee
someOtherEmail@there.comJane Doe
someEmail1@here.comJacob Smith

<tbody>
</tbody>

My Expected Output would be:

Jane DoesomeEmail1@here.com someOtherEmail@there.com
Johnny LeesomeOtherEmail@there.com
Jacob SmithsomeEmail1@here.com

<tbody>
</tbody>

Essentially I need a formula that will combine the values of the groups column but match it
on the names in the rows. Please note that the names are random, the emails are random, and there are repeating names.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Perhaps:

ABCDEF
1GROUPEMPLOYEEEMPLOYEEEmail
2someEmail1@here.comJane DoeJane DoesomeEmail1@here.comsomeOtherEmail@there.com
3someOtherEmail@there.comJohnny LeeJohnny LeesomeOtherEmail@there.com
4someOtherEmail@there.comJane DoeJacob SmithsomeEmail1@here.com
5someEmail1@here.comJacob Smith

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet11

Worksheet Formulas
CellFormula
D2=IFERROR(INDEX($B$2:$B$10,AGGREGATE(15,6,(ROW($B$2:$B$10)-ROW($B$2)+1)/(($B$2:$B$10<>"")*(COUNTIF($D$1:$D1,$B$2:$B$10)=0)),1)),"")
E2=IFERROR(INDEX($A$2:$A$10,AGGREGATE(15,6,(ROW($B$2:$B$10)-ROW($B$2)+1)/(($B$2:$B$10=$D2)*(COUNTIF($D2:D2,$A$2:$A$10)=0)),1)),"")&""

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


Put the D2 formula in and drag down. Put the E2 formula in and drag down and across as needed.
 
Upvote 0
Whenever I try that formula it only returns 3 names for the D2 column.

Disregard, I forgot to update the cell references. I do however have one thing I need to figure out with your E2 formula. Instead of dragging it out, I need it to all be in the same cell and spaced by a new line within that cell. Thoughts?
 
Upvote 0
If you have Excel 365, you can use TEXTJOIN in the E column (from Eric's table) and flll down to only the unique values showing in column D.
It's an array formula, entered with CTRL+Shift+Enter

Code:
=TEXTJOIN(" ",TRUE,IF(D2=A2:A10,B2:B10,""))

You can make the space delimiter CHAR(10) and then wrap text if you want them on separate lines.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,356
Messages
6,124,475
Members
449,164
Latest member
Monchichi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top