+ Reply to Thread
Results 1 to 9 of 9

Help Concatenate All Cells In A Column To A Single Cell In Another Column

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    Jupiter
    MS-Off Ver
    10
    Posts
    3

    Help Concatenate All Cells In A Column To A Single Cell In Another Column

    I have three columns. Column A has a list of file names. Column B has each cell filled with the word OR. Column C Concatenates Columns A and B together to give me something like this:

    Document01 OR
    Document02 OR
    Document03 OR
    Document04 OR

    What I'd like to do with this is concatenate all of the cells in Column C into the first cell of Column D, to give me something like this:

    Document01 OR Document 02 OR Document03 OR Document04

    I can then copy and paste that cell into a search box in windows (or another file finding program) to find all of the files I originally pasted in Column A.

    I have everything working except that I have to edit the formula in the first cell of Column D by hand, adding every cell I'd like to concatenate to it like this:

    =CONCATENATE(C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C258,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47,C48,C49,C50,C51,C52,C53,C54,C55,C56,C57,C58,C59,C60,C61,C62,C63,C64,C65,C66,C67,C68,C69,C70,C71,C72,C73,C74,C75,C76,C77,C78,C79,C80,C81,C82,C83,C84,C85,C86,C87,C88,C89,C90,C91,C92,C93,C94,C95,C96,C97,C98,C99,C100)

    Is there an easier way to do this? Note that I won't always know exactly how many cells I'll have filled in Column A. If I could make it concatenate infinately that would be great. Or at least up to 2000 if that's possible. Sorry if this is a stupid question, I'm new to excel and formulas.

    I've attached a copy of what I have so far.

    Thanks!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Rahul Nagar's Avatar
    Join Date
    09-18-2008
    Location
    nasik
    MS-Off Ver
    Excel 2003
    Posts
    465

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    Hello imnickb

    1st copy your column C and
    2nd paste special Transpose
    3rd copy all data and paste in note pad
    4th again copy from note pad and then paste in one cell
    __________________
    Regards
    Rahul Nagar
    Founder of www.myshortcutkeys.com.


    If you get the answer of your questions then please click EDIT in your original post then click on GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.

  3. #3
    Registered User
    Join Date
    06-19-2012
    Location
    Jupiter
    MS-Off Ver
    10
    Posts
    3

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    Quote Originally Posted by Rahul Nagar View Post
    1st copy your column C and
    2nd paste special Transpose
    Thanks for the help, but that doesn't appear to be working. When I copy Column C and paste it I just get a bunch of this: #REF!.
    I assume that when I do the copy, it's trying to copy the formula that's in the cell, not the results of the formula. I'm sure there's a way to copy it properly but I'm unable to do it. I'll keep trying different things.

  4. #4
    Valued Forum Contributor Rahul Nagar's Avatar
    Join Date
    09-18-2008
    Location
    nasik
    MS-Off Ver
    Excel 2003
    Posts
    465

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    1st copy your column C and paste as value
    2nd copy again and paste special Transpose
    3rd copy all data and paste in note pad
    4th again copy from note pad and then paste in one cell

  5. #5
    Registered User
    Join Date
    06-19-2012
    Location
    Jupiter
    MS-Off Ver
    10
    Posts
    3

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    Thanks! I appreciate the help! I was hoping to do this with less copying and pasting however. It is a solution for now at least. Thanks!

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    Here, try this UDF:

    First one use C column
    Second one use A column
    Attached Files Attached Files

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    Perhaps

    In D2: =C2
    In D3: =D2&C3 and dragged down

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    Assuming you have contiguous data in column C, put this in D2:

    =C2

    and this in D3:

    =D2 & C3

    then copy this down to the bottom of your data - hint, select D3 then double-click the fill handle (the small black square in the bottom right corner of the cursor.

    The bottom cell will now contain all those concatenated values, so you could get them into cell E2, for example, using this:

    =INDIRECT("D"&COUNTA(D:D))

    Hope this helps.

    Pete

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

    Re: Help Concatenate All Cells In A Column To A Single Cell In Another Column

    or a variation on the copy paste
    copy just column a
    past special into Word unformatted text
    use find replace
    find ^p (that is paragraph mark)
    replace with space OR ie " OR" without quotes
    copy paste back into excel
    "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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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