Closed Thread
Results 1 to 18 of 18

Need TextJoin Alternative for MS Excel 2016

  1. #1
    Registered User
    Join Date
    06-22-2020
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    14

    Need TextJoin Alternative for MS Excel 2016

    Hello Everyone,

    So since The TEXTJOIN formula is incompatible with Excel 2016, I was wondering if there was an alternative formula or VBA code.

    The formula I was using was {="• "&TEXTJOIN(CHAR(10)&"• ",TRUE,IF(risks[Likelihood]=$C3,IF(risks[Impact]=D$8,risks[Title],""),""))}

    This formula plots the name of the risk on a chart depending on it's probability score and impact score. See attached for the visual. Textjoin would be

    The formula allows for multiple risks to be inputted in a single cell.

    Can this still be done without the TEXTJOIN Function?

    risk-map (2).xlsx
    Attached Images Attached Images

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Need TextJoin Alternative for MS Excel 2016

    Hi and welcome to the forum

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-22-2020
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    14
    Hi, there absolutely is a file attached. Please read the post
    Last edited by AliGW; 11-28-2020 at 04:46 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,826

    Re: Need TextJoin Alternative for MS Excel 2016

    Are you required to use Excel? LO calc, Gnumeric, and Google sheets all support the TEXTJOIN() function without hiding the function behind a subscription wall. Often, when I want one of the newer functions that my older version of Excel doesn't support, I see if the function is available in open source spreadsheets and use another spreadsheet.

    The TEXTJOIN() function is essentially the same as the VBA Join() function. It should be possible to write a VBA UDF that will provide the same functionality, but it will not automatically "plug and play" into existing spreadsheets. You will need to do some kind of find/replace to use your UDF in files that you receive from others, and they will need some kind of find replace to replace your UDF with the TEXTJOIN() function in their version. (In short, this makes it harder to share your files with others if these are projects that need to pass around between other team members).

    Those are the two main approaches I use to get the same functionality as the TEXTJOIN() function. The best approach may depend on details that you have not shared with us.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,408

    Re: Need TextJoin Alternative for MS Excel 2016

    Custom function, is it the result you want
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Need TextJoin Alternative for MS Excel 2016

    As others have mentioned, VBA user-defined functions are your only option. However, one caveat: Excel 2019 and later TEXTJOIN supports 3D ranges, that is,

    =TEXTJOIN(", ",1,Sheet1:Sheet4!B5:G10)

    iterates through the 3D block in the same order that NPV iterates through 3D blocks as its 2nd argument. VBA still can't handle 3D references. Probably NBD.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Need TextJoin Alternative for MS Excel 2016

    Please try at
    Data G6
    ="• "&C6&IFNA(CHAR(10)&"• "&INDEX(C7:C$46,MATCH(D6*10+E6,INDEX(D7:D$46*10+E7:E$46,),)),"")

    Rename column header G5 to Join

    Risk Map D3:H7
    =IFNA(INDEX(risks[Join],MATCH(D$8*10+$C3,INDEX(risks[Impact]*10+risks[Likelihood],),)),"")
    Attached Files Attached Files

  8. #8
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Need TextJoin Alternative for MS Excel 2016

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-22-2020
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    14

    Re: Need TextJoin Alternative for MS Excel 2016

    Quote Originally Posted by MrShorty View Post
    Are you required to use Excel? LO calc, Gnumeric, and Google sheets all support the TEXTJOIN() function without hiding the function behind a subscription wall. Often, when I want one of the newer functions that my older version of Excel doesn't support, I see if the function is available in open source spreadsheets and use another spreadsheet.

    The TEXTJOIN() function is essentially the same as the VBA Join() function. It should be possible to write a VBA UDF that will provide the same functionality, but it will not automatically "plug and play" into existing spreadsheets. You will need to do some kind of find/replace to use your UDF in files that you receive from others, and they will need some kind of find replace to replace your UDF with the TEXTJOIN() function in their version. (In short, this makes it harder to share your files with others if these are projects that need to pass around between other team members).

    Those are the two main approaches I use to get the same functionality as the TEXTJOIN() function. The best approach may depend on details that you have not shared with us.
    Thanks for the reply. I'll admit, I did not consider using google sheets or other free spreadsheet options to get around the different versions with their varying features. It would be difficult however because this one massive workbook that this probability and impact matrix is located in contains many other sheets so the formatting and maybe some of the other formulas wouldn't transfer over, so it would take some work. Although that's a good idea to keep in mind, I should probably consider making a google sheet version of the workbook to give people who don't have an office 365 subscription another option.

  10. #10
    Registered User
    Join Date
    06-22-2020
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    14

    Re: Need TextJoin Alternative for MS Excel 2016

    Quote Originally Posted by wk9128 View Post
    Custom function, is it the result you want
    This works great! The only thing I would add is another bullet point to cover the first risk added to the matrix. Thank you!!

  11. #11
    Registered User
    Join Date
    06-22-2020
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    14

    Re: Need TextJoin Alternative for MS Excel 2016

    Quote Originally Posted by Bo_Ry View Post
    Please try at
    Data G6
    ="• "&C6&IFNA(CHAR(10)&"• "&INDEX(C7:C$46,MATCH(D6*10+E6,INDEX(D7:D$46*10+E7:E$46,),)),"")

    Rename column header G5 to Join

    Risk Map D3:H7
    =IFNA(INDEX(risks[Join],MATCH(D$8*10+$C3,INDEX(risks[Impact]*10+risks[Likelihood],),)),"")
    This works perfectly, and without any vba. This works for risk probabilities and impacts categorized as numbers 1-5, but it wouldn't be difficult at all to take subjective ratings (i.e. "Very Low", "Medium", "High", etc.) and assign corresponding values if needed. Thank you kindly

  12. #12
    Registered User
    Join Date
    06-22-2020
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    14

    Re: Need TextJoin Alternative for MS Excel 2016

    Quote Originally Posted by BMV View Post
    Please Login or Register  to view this content.
    This is another great option for a UDF that mimics TextJoin! Works great You're a genius. Thank you.

    ОБЪЕДИНИТЬ = Combine

  13. #13
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Need TextJoin Alternative for MS Excel 2016

    Why both ARG and ARG1, and ARG undeclared?

    Why the Application.Transpose call in all cases? It's necessary for arrays but not Ranges since VBA, in MSFT's infinite wisdom, iterates differently through SomeRange.Cells and SomeRange.Value.

    Why the overhead of a subfunction call? If you always use RESULT = RESULT & Delimiter & CStr(X), then all you need at the end is TEXTJOIN = Mid$(RESULT, Len(Delimiter) + 1). Much more efficient than an unnecessary function call for every X.

    Finally, while VBA doesn't support 3D references, it does support multiple area ranges. Overengineered, but a closer alternative,

    Please Login or Register  to view this content.

  14. #14
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Need TextJoin Alternative for MS Excel 2016

    hrlngrv
    Please Login or Register  to view this content.
    will work but any operation with range a little bit slow then with array.

  15. #15
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Need TextJoin Alternative for MS Excel 2016

    Fair point. Handle multiple-area ranges separately, and single area ranges by converting to their .Value arrays.

    Please Login or Register  to view this content.
    Then use a profiling macro.

    Please Login or Register  to view this content.
    Yes, processing single-area ranges is slower than processing arrays, and processing multiple-area ranges is a lot slower still. However, if a TEXTJOIN replacement needs to function as close to the actual TEXTJOIN in Excel 2019 and later, isn't slow preferable to impossible?

    Given the profiling macro above, on my system processing multiple-area ranges takes 140% more time than 1D arrays, processing single-area ranges takes 40% more time than 1D arrays, and processing 2D arrays takes 11% more time than 1D arrays (I supplemented the macro above for 2D arrays).

    Note also that my profiling macro performs 500,000 iterations. Each For loop takes under 30 seconds, so each iteration, thus textjoin call, takes on the order of tens of microseconds. Given the speed of individual calls, my own preferences is to handle multiple-area ranges. That's subjective; others may have different preferences.

  16. #16
    Registered User
    Join Date
    07-05-2021
    Location
    Spain
    MS-Off Ver
    2016
    Posts
    2

    Re: Need TextJoin Alternative for MS Excel 2016

    Thank you so much for your idea!!

    I´m trying to make it work but I´m not able....it only detects the lines that are under each and only, if you have three risks with the same value, only detects the first two and I´m not able to identify why!! Could you please have a look?

    Actually I cannot use vba code in our sheets, so I´m looking at this kind of solution.
    Regards!!

  17. #17
    Registered User
    Join Date
    07-05-2021
    Location
    Spain
    MS-Off Ver
    2016
    Posts
    2

    Re: Need TextJoin Alternative for MS Excel 2016

    Quote Originally Posted by Bo_Ry View Post
    Please try at
    Data G6
    ="• "&C6&IFNA(CHAR(10)&"• "&INDEX(C7:C$46,MATCH(D6*10+E6,INDEX(D7:D$46*10+E7:E$46,),)),"")

    Rename column header G5 to Join

    Risk Map D3:H7
    =IFNA(INDEX(risks[Join],MATCH(D$8*10+$C3,INDEX(risks[Impact]*10+risks[Likelihood],),)),"")
    Thank you so much for your idea!!

    I´m trying to make it work but I´m not able....it only detects the lines that are under each and only, if you have three risks with the same value, only detects the first two and I´m not able to identify why!! Could you please have a look?

    Actually I cannot use vba code in our sheets, so I´m looking at this kind of solution.
    Regards!!

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Need TextJoin Alternative for MS Excel 2016

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Textjoin Alternative
    By getafixkwik in forum Excel General
    Replies: 10
    Last Post: 04-05-2020, 11:28 AM
  2. [SOLVED] TEXTJOIN missing from MS Office Home and Student 2016
    By MikeA01730 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-10-2019, 01:22 PM
  3. Replies: 0
    Last Post: 11-20-2019, 04:05 AM
  4. Replies: 1
    Last Post: 09-18-2017, 08:27 AM
  5. Help! Automated Email coding for Excel 2016 and Outlook 2016 problems
    By lisa6421 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-01-2017, 08:07 AM
  6. Using TextJoin (Excel 2016) in VBA
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2017, 06:52 PM
  7. [SOLVED] The alternative for FileCopy for office 2016
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-18-2016, 06:26 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