+ Reply to Thread
Results 1 to 12 of 12

TEXTJOIN formula with 2 expetions

  1. #1
    Registered User
    Join Date
    11-25-2023
    Location
    Italy
    MS-Off Ver
    2019
    Posts
    4

    TEXTJOIN formula with 2 expetions

    Hi everybody,
    I please need your help

    In the range W3:AB11 I'm using the VLOOKUP formula to get a text from another page, if it doesn't find anything it will write 0

    In this W3:AB11 range I can have some values repeated once, some twice and some multiple times; I also have some 0.

    In the cell W18 I want to get, from alle the values in the range W3:AB11 only the text ones, but I need each text value to be written only once


    I attach a picture to better show what I need to do. I use excel 2019. In this specific case, I only need to get FISH, SOY, SESAM, GLUTEN



    I've been struggling on this formula for a couple of days and I'd really appreciate some help
    Thanks in advance
    Attached Images Attached Images

  2. #2
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,890

    Re: TEXTJOIN formula with 2 expetions

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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.

  3. #3
    Registered User
    Join Date
    11-25-2023
    Location
    Italy
    MS-Off Ver
    2019
    Posts
    4

    Re: TEXTJOIN formula with 2 expetions

    Hi, and thanks for the welcome

    My bad, I have now attached the file with the formula I'm currently using and few notes about it

    Thanks
    S
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,484

    Re: TEXTJOIN formula with 2 expetions

    A slightly horrible formula, that will work well in smaller files:

    =IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW($W$3:$AB$11)*100+COLUMN($W$3:$AB$11))/(($W$3:$AB$11<>0)*(COUNTIF($W$17:W17,$W$3:$AB$11)=0)),1),"R0C00"),FALSE),"")


    or...

    a very horrible formula that will work fine in large files. The difference is the use of INDIRECT which recalculates every time anything changes and therefore can cause performance issues.

    =IFERROR(INDEX($1:$1048576,AGGREGATE(15,6,ROW($W$3:$AB$11)/(($W$3:$AB$11<>0)*(COUNTIF(X$17:X17,$W$3:$AB$11)=0)),1),10^6*MOD(AGGREGATE(15,6,ROW($W$3:$AB$11)+(COLUMN($W$3:$AB$11)*10^-6)/(($W$3:$AB$11<>0)*(COUNTIF(X$17:X17,$W$3:$AB$11)=0)),1),1)),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,484

    Re: TEXTJOIN formula with 2 expetions

    My file uses the cell references that you gave originally. You can adjust them to suit your sample file if the cell references in YOUR sample file are the ones you're using.

  6. #6
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,890

    Re: TEXTJOIN formula with 2 expetions

    This would have been so easy using 365!!!

    e.g.

    =LET(t,TOCOL(C2:H16),TEXTJOIN(", ",,UNIQUE(TRIM(FILTER(t,t<>0)))))

    TRIM because there's a trailing space issue with SESAM.
    Last edited by AliGW; 11-25-2023 at 06:39 AM. Reason: Added example.

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: TEXTJOIN formula with 2 expetions

    With Excel 2019 there is no UNIQE function but it can still be done with a formula.
    It can be found here: https://www.get-digital-help.com/uni...ay-formulas/#2

    There is a sample workbook you can download.
    Last edited by Jacc; 11-25-2023 at 06:45 AM.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  8. #8
    Registered User
    Join Date
    11-25-2023
    Location
    Italy
    MS-Off Ver
    2019
    Posts
    4

    Re: TEXTJOIN formula with 2 expetions

    Hi Glenn, that's great, Thanks. I was wondering, would it be possible to get the values you have in your file in W14:W17 (or X14:X17) in a single cell, and separate each allergen with a comma and a space?

    Thanks again for all the help and the support, to all of you!
    Last edited by AliGW; 11-25-2023 at 06:51 AM. Reason: Please do NOT quote unnecessarily! Use the QUICK REPLY button instead.

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,686

    Re: TEXTJOIN formula with 2 expetions

    Pl see file. Data range B3:E11
    In H3 copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,484

    Re: TEXTJOIN formula with 2 expetions

    You will need a User-Defined function for that (saved as an xlsm file). Is that acceptable?

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,484

    Re: TEXTJOIN formula with 2 expetions

    I have assumed that it is OK. VBA code:

    Please Login or Register  to view this content.
    Formula (this will be an array formula in your Excel version):

    =ConcatAll(IF(($W$3:$AB$11<>0),$W$3:$AB$11,""),", ",TRUE)


    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-25-2023
    Location
    Italy
    MS-Off Ver
    2019
    Posts
    4

    Re: TEXTJOIN formula with 2 expetions

    It worked, I really thank everyone of you for your patience and your help!!

+ 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. Remove duplicated in TEXTJOIN formula
    By caamfin in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-14-2023, 03:01 AM
  2. TextJoin Formula Suggested Solution
    By CRJ42 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-11-2022, 12:12 PM
  3. Formula to merge duplicate and textjoin
    By Muneer1977 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-16-2022, 07:15 AM
  4. [SOLVED] Formula to TEXTJOIN if column contains the same values
    By YMUNSHI in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-26-2021, 10:23 PM
  5. [SOLVED] formula to extract, count then textjoin
    By aan.isnaini in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 12-08-2021, 03:15 PM
  6. [SOLVED] TEXTJOIN in a Spill Array Formula
    By DJunqueira in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-12-2021, 02:33 PM
  7. [SOLVED] TextJoin formula with MID function
    By Brsth in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-26-2018, 11:00 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