+ Reply to Thread
Results 1 to 14 of 14

Combining "standard" strings of text in one cell, if any text in cells.

  1. #1
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Post Combining "standard" strings of text in one cell, if any text in cells.

    I have a "comments" cell, which should contain a "standard" text phrase, if there are any values in certain cells. About 10 cells must be connected to this cell. The 10 cells are all containing numbers, and for each cell, if there is a number, a text must be come up in the "comments" cell. If there are multiple cells with numbers, the different text strings should be separated by a comma. I have attached an example sheet.
    Attached Files Attached Files
    Last edited by Allerdrengen; 10-25-2018 at 07:25 AM.

  2. #2
    Forum Contributor
    Join Date
    04-30-2015
    Location
    The Netherlands
    MS-Off Ver
    office 365
    Posts
    195

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Hi,

    Your file hasn't been attached. The paperclip sadly doesn't work.

    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"

    Ferdy
    Remember to mark as Solved and give out rep.

  3. #3
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Hi,

    Thanks, my bad!

  4. #4
    Forum Contributor
    Join Date
    04-30-2015
    Location
    The Netherlands
    MS-Off Ver
    office 365
    Posts
    195

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    What is the text that should be coming up, as we just see the numbers atm, we can only connect those in the comment cell. We don't really know what you want in the comments field, does it pull the comments from somewhere, or are there standard phrases for each column.

  5. #5
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    There are standard phrases for each column. So each time there is a number in "Cell 2" for instance, the same text string should show in the related "comments" cell.
    So in this example there should be 10 different text strings. I'm not sure whether to pull them from somewhere or if there is a better way.
    Thanks!

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

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Please try at K2 with Ctrl+Shift+Enter then copy down

    =textjoin(", ",,IF(A2:J2<>"","Cell " &COLUMN(A2:J2)&" text string",""))

  7. #7
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Thanks for your response!
    The problem in that is that all the strings are completely different, and this would give me almost the same strings. The strings are not related to what is written in the cells.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    In the sample file all of the text strings are almost the same, except for the column number reference. If that isn't what you want the comment cell to display, then please upload another file showing what you expect to see based on the content of the cells in columns A:J
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  9. #9
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Yes! A more accurate file is now uploaded.
    Thank you.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    It may be that the TEXTJOIN function would do this more efficiently, however I can't use it as I only have the 2010 version of Excel, so here is a lengthy formula that yields the comments shown in the file:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that each 'Statement' is found in the appropriate cell in row 9 and could be moved and/or hidden for aesthetic purposes.
    Let us know if you have any questions.
    Attached Files Attached Files

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

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Please try at K2 with Ctrl+Shift+Enter
    textjoin for display text from row1, you need to add full text at row1 or as JeteMc suggest, add helper row with full text and change $A$1:$J$1 to that row


    =textjoin(", ",,IF(A2:J2<>"",($A$1:$J$1),""))

  12. #12
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Thank you very much, it almost does the job. However, i failed to mention that the numbers appearing in the cells are from functions in the cells. So the textjoin method thinks there a values in the cells, even though its just functions. Is there a way, to tell the textjoin function that it should only join the text, if there a numbers appearing in the cell?

  13. #13
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    Nevermind, figured it out! Thank you both, repped.

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

    Re: Combining "standard" strings of text in one cell, if any text in cells.

    How about

    =textjoin(", ",,IF(ISNUMBER(A2:J2),($A$1:$J$1),""))

+ 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. Replies: 2
    Last Post: 03-22-2018, 06:34 AM
  2. Replies: 4
    Last Post: 06-11-2017, 02:03 PM
  3. [SOLVED] Text strings separated with "/", ",", "-" or "&"
    By alice2011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2015, 02:13 PM
  4. [SOLVED] formula for "if a cell contain text" wen looking for 2 separated strings
    By Tamar81 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-11-2013, 01:59 AM
  5. Replies: 11
    Last Post: 11-21-2013, 01:16 PM
  6. Find "TEXT 1" in a range and enter "TEXT 2" in the adjacent cell
    By madreag in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-28-2013, 05:34 PM
  7. Joining text strings with "some" formatting in Excel 2008
    By Dano in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-06-2008, 05:13 AM

Tags for this Thread

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