TEXTJOIN Alternative

mightymo77

New Member
Joined
Dec 16, 2021
Messages
17
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
Hey guys. I was reading through some posts and everyone here seems very helpful. I have this formula below, however it's not working on my work machine which uses Excel 2016. Can anyone create an alternative for me that will function in Excel 2016? I would appreciate any help!

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(FIND($F2:$T2,"BLACK,BLUE")),$F$1:$T$1,""))
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I would also be interested in a textjoin alternative to overcome the size limitations, which if I remember is 2500 or so.
 
Upvote 0
I wrote up a UDF that imitates TEXTJOIN, look here:


To install it, press Alt-F11 to open the VBA editor. Press Alt-IM to Insert a Module. Paste the code into the window that opens. Press Alt-Q to close the editor. Then you should be able to use TEXTJOINX where you would want to use TEXTJOIN. It's been quite a while since I looked at it, but it should work. I don't think I ever tested size limitations, but I'm unaware of any problems.
 
Upvote 0
With a UDF: (put this behind a module - > open VBA, insert a new module and paste)

VBA Code:
Function jec(searchRng As Range) As String
 Dim it As Variant, c00 As String
  For Each it In searchRng
    If InStr(it, "BLACK,BLUE") Then c00 = c00 & ", " & it.Offset(-1).Value
  Next
  jec = Mid(c00, 3)
End Function

Excel Formula:
=jec(F2:T2)
 
Last edited:
Upvote 0
Thank you. I am getting "Compile error: Expected: list separator or )". I never ran a VBA code before. What I did was press ALT + F11, right-click Modules > Insert > Module > Pasted your first code > closed the window and did not save the macro > closed the next window which brought me back to my csv file > pasted the second code in X2 > It brought back the module window with the error.
 
Upvote 0
I actually didn't, what is wrong? :LOL:
 
Upvote 0
It's checking the wrong way round. :eek:
 
Upvote 0
It is supposed to textjoin F1:T1 right?
 
Upvote 0

Forum statistics

Threads
1,215,410
Messages
6,124,752
Members
449,186
Latest member
HBryant

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