Textjoin in an array using a search string

mackensteff

Board Regular
Joined
Feb 9, 2010
Messages
74
Office Version
  1. 365
Platform
  1. MacOS
Hello,

I have being trying to use the new text join function in a formula with the criteria being to find a search string, and then joining cells that meet that criteria. In short the following is what I am hoping to accomplish when searching for "W" in the second column:

[TABLE="width: 352"]
<colgroup><col width="88" span="4" style="width: 66pt;"></colgroup><tbody>[TR]
[TD="class: xl63, width: 88"]Name[/TD]
[TD="class: xl63, width: 88"]Day[/TD]
[TD="class: xl63, width: 88"][/TD]
[TD="class: xl63, width: 88"]Expected Result[/TD]
[/TR]
[TR]
[TD="class: xl63"]Bob[/TD]
[TD="class: xl63"]W[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"]Bob, Sue, Jane, Jill[/TD]
[/TR]
[TR]
[TD="class: xl63"]Sue[/TD]
[TD="class: xl63"]WF[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]Tim[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]Jane[/TD]
[TD="class: xl63"]MWF[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]Jack[/TD]
[TD="class: xl63"]TR[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"]Jill[/TD]
[TD="class: xl63"]MTWRF[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
</tbody>[/TABLE]

The issue seems to be using search, or find or countif in an array formula to identify the cells for textjoin.

Anyone want to give it a go?

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
The syntax for TEXTJOIN is as follows...

[TABLE="width: 600"]
<tbody>[TR]
[TD="width: 211"]TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)[/TD]
[/TR]
</tbody>[/TABLE]

Therefore, assuming that Columns A and B contain the data, try the following formula that needs to be confirmed with CONTROL+SHIFT+ENTER...

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(SEARCH("W",B2:B7)),A2:A7,""))

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,223,639
Messages
6,173,499
Members
452,517
Latest member
SoerenB

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