+ Reply to Thread
Results 1 to 7 of 7

Append texts into one string from 4 cells that each cell has a formula

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Append texts into one string from 4 cells that each cell has a formula

    Hi,
    I have problem to append texts into one string from 4 cells that each cell has a formula.

    I can join all the texts from 4 cells in cell A1 using A1&A2&A3&A4, but cell B1, C1 and
    D1 blocks the length of the text. I do not want to widen cell A1 to show the full length of text,
    and delete the formulas in B1,C1 and D1. Please see more in the attached file.

    Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Append texts into one string from 4 cells that each cell has a formula

    If you have a formula genetating the text you want to combine, have you tried to add/remove spaces in THOSE formulas 1st? If none if the answers begin/end with a space, then it's easy to add then where needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Append texts into one string from 4 cells that each cell has a formula

    to achieve the spacing add them then trim
    =TRIM(A1&" "&B1&" "&C1&" "&D1)
    so your formula would be
    =TRIM(IF(F2="Yes","Let's go","")&" "&B14&" "&C14&" "&D14)


    the others should also include an result for if f2<>yes probably blank ie ""
    =IF(F2="Yes","to the","") =IF(F2="Yes","park has","") =IF(F2="Yes","some fun.","")

    not sure about 3.
    cell B13, C13,D13 blocks the text. I do not want to delet the formulas in B4,C4,D4 in order to show the text.
    text will not show across cells if something is in the adjacent cell(s)
    Last edited by martindwilson; 07-27-2013 at 05:58 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Append texts into one string from 4 cells that each cell has a formula

    Thanks,
    I try to show text across the cells. In my spread sheets, I have four columns (few hundred rows theinformations are different in each row.
    Most of the rows, the contents are in seperate columns with numbers and texts except some of them should be one line of text in A1.

    Maybe something like this,
    If "yes", =TRIM(IF(F2="Yes","Let's go","")&" "&B14&" "&C14&" "&D14); then clear contents in cell B1, C1 and D1. This will allow text to cross cells.
    If "No", copy all the formulas back to cell A1, B1, C1 and D1.

    Thanks

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Append texts into one string from 4 cells that each cell has a formula

    its not going to happen anything in a cell will stop the text extending over it that includes a formula
    the onlyway would be to write vba code to do the whole thing

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Append texts into one string from 4 cells that each cell has a formula

    OK I guess my comment was more regarding the extra/lack of spaces in the text. maybe if you included a carriage return in the concatenate formula, and set the cell to wrap?

  7. #7
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: Append texts into one string from 4 cells that each cell has a formula

    I am OK with VBA. Should I repost this topic in VBA section or do it here?

    Thanks,

+ 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. excel formula to grab first text in a string of texts
    By ewong in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2012, 07:08 PM
  2. if cell includes string, append a character to the value of another cell.
    By robbyvegas in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-04-2012, 12:08 AM
  3. [SOLVED] How to Find and Replace a string if cell does not contain certain texts.
    By windcloud2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-04-2012, 01:04 PM
  4. Adding(Append) fix string before a particular cell
    By prayami in forum Excel General
    Replies: 1
    Last Post: 01-02-2008, 05:29 PM
  5. Compare a string in two columns, if match then append string from third column
    By Londonderry in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2007, 03:41 PM

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