+ Reply to Thread
Results 1 to 12 of 12

Concatenating 2 or more data points

  1. #1
    Registered User
    Join Date
    12-16-2020
    Location
    Florida, USA
    MS-Off Ver
    Excel Version 2009
    Posts
    6

    Concatenating 2 or more data points

    Hi Folks - not even sure how to describe this without visuals, so i'm posting a dummy sheet with an example. I'm working with school data, where a student may have failed 2 or more subjects. I want to have those subjects in the same cell, separated by a comma so that i can blend it into a mail-merge document. This way, each student will only be listed once, as opposed to what you see in the attached sheet. ID is the student, and the course listed is what they've failed.

    I'm not sure Excel can do this, but i thought i'd ask. The more info i can give to our counselors, the quicker we can see more kids. Thanks for any help you can offer, even if it's a "no-way!"

    Marylea
    Attached Files Attached Files

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

    Re: Concatenating 2 or more data points

    I'm not sure which version 2009 is. If your version of Excel supports the TEXTJOIN() function, and array function like =TEXTJOIN(",",TRUE,IF($A$2:$A$17="1ydsp",$B$2:$B$17,"")) will join the specified text strings into a comma separated text string.

    If your version of Excel does not support the TEXTJOIN() function, the same array function will work in free spreadsheet like LO calc.

    If there is no way to use a spreadsheet that supports the TEXTJOIN() function, I'm sure we could put something together, but let's first determine if a TEXTJOIN() based option will be allowed in your scenario.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    12-16-2020
    Location
    Florida, USA
    MS-Off Ver
    Excel Version 2009
    Posts
    6

    Re: Concatenating 2 or more data points

    Hmmm . . . just watched a video on that function and i'm not sure that will work. I want to blend info that runs vertically - not horizontally. Concatenate may not even be the correct term for what i want to do. From the data set i shared, i want to blend B2, B3, & B4 altogether in B2 to make for one entry per student. This would ping off their ID code in column A, or so i would think.
    Last edited by melueth; 12-16-2020 at 06:39 PM.

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

    Re: Concatenating 2 or more data points

    currently use Glenn Kennedy moderator custom VBA formula C2 cell , array formula , drag down

    HTML Code: 
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-16-2020
    Location
    Florida, USA
    MS-Off Ver
    Excel Version 2009
    Posts
    6

    Re: Concatenating 2 or more data points

    I know this will work . . . i see that in the test file you reloaded once i enabled macros in that file. Unfortunately, I am not advanced enough to know how to enter that same VBA into the sheet i really need it in. I've created macros before, but strictly through recording steps. I can get into the VBA file area, but i'm not sure what to do once i get there. It seems to be tied only to the test file . . . would love to be able to use this in my massive data file! Thank you for your help!
    Last edited by AliGW; 12-17-2020 at 10:41 AM. Reason: PLEASE don't quote unnecessarily!

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

    Re: Concatenating 2 or more data points

    I want to blend info that runs vertically - not horizontally.
    I'm not sure what video you watched or where you get the impression that TEXTJOIN() only works for horizontal data. I don't have an Excel version, but LO Calc has not trouble with vertical data in the TEXTJOIN() function or the array IF() function. Unless I am misunderstanding something, it looks like either approach works, so you can choose which approach you like.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-16-2020
    Location
    Florida, USA
    MS-Off Ver
    Excel Version 2009
    Posts
    6

    Re: Concatenating 2 or more data points

    Quote Originally Posted by MrShorty View Post
    I'm not sure what video you watched or where you get the impression that TEXTJOIN() only works for horizontal data. I don't have an Excel version, but LO Calc has not trouble with vertical data in the TEXTJOIN() function or the array IF() function. Unless I am misunderstanding something, it looks like either approach works, so you can choose which approach you like.
    Wow - sorry - i see that now. Thank you!

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

    Re: Concatenating 2 or more data points

    {=CONCATY(IF(1,B2:B4,""))}

    OR

    {=CONCATY(IF(B2:B4<>"",B2:B4,""))}


    Customization can be used with worksheets. I also wrote VBA. The TEXTJOIN function is exactly the same as OFFICE2019 and MS365. Even if everyone has OFFICE2019 and MS365, my TEXTJOIN can only use the old version below 2019

  9. #9
    Registered User
    Join Date
    12-16-2020
    Location
    Florida, USA
    MS-Off Ver
    Excel Version 2009
    Posts
    6

    Re: Concatenating 2 or more data points

    Quote Originally Posted by MrShorty View Post
    I'm not sure what video you watched or where you get the impression that TEXTJOIN() only works for horizontal data. I don't have an Excel version, but LO Calc has not trouble with vertical data in the TEXTJOIN() function or the array IF() function. Unless I am misunderstanding something, it looks like either approach works, so you can choose which approach you like.
    Looking at your original TEXTJOIN function, i see that you give just one ID code . . . is there a way to ping off of several without having to enter each textjoin command? I have over 1000 kids on this list to concatenate.

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

    Re: Concatenating 2 or more data points

    Enter each unique student id (some of Excel's filter tools have an option to return a list of unique entries from a range if you don't want to enter each student id separately). Make sure the formula has the right combination of relative and absolute references and copy/paste/fill the formula down as far as your unique list of students goes.
    If your Excel version supports it, there is the new UNIQUE() function.
    This tutorial describes how to use Advanced filter to create a list of unique entries: https://www.techrepublic.com/blog/mi...-excel-column/
    I have also used a simple pivot table to create a list of unique entries.

  11. #11
    Registered User
    Join Date
    12-16-2020
    Location
    Florida, USA
    MS-Off Ver
    Excel Version 2009
    Posts
    6

    Re: Concatenating 2 or more data points

    Quote Originally Posted by MrShorty View Post
    Enter each unique student id (some of Excel's filter tools have an option to return a list of unique entries from a range if you don't want to enter each student id separately). Make sure the formula has the right combination of relative and absolute references and copy/paste/fill the formula down as far as your unique list of students goes.
    If your Excel version supports it, there is the new UNIQUE() function.
    This tutorial describes how to use Advanced filter to create a list of unique entries . . .
    OK, thank you. I will study this and try for it. I had to simplify today, as i was out of time, but i need to learn this function for the future. Thanks again.

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

    Re: Concatenating 2 or more data points

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'.

+ 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. [SOLVED] Concatenating Data
    By amberle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-16-2019, 01:29 PM
  2. Color chart data points/marker points vba error
    By nmckever in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2014, 07:10 AM
  3. [SOLVED] Concatenating two columns and reversing after concatenating the result
    By irfanparbatani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2014, 09:35 PM
  4. Which way of concatenating data works better?
    By KLH in forum Excel General
    Replies: 2
    Last Post: 06-20-2011, 05:16 PM
  5. Replies: 0
    Last Post: 10-08-2010, 12:29 PM
  6. Concatenating a column of data
    By gazmond in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2010, 11:58 AM
  7. Replies: 4
    Last Post: 05-30-2008, 10:39 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