+ Reply to Thread
Results 1 to 10 of 10

Adapt CONCATENATE to skip rows

  1. #1
    Registered User
    Join Date
    10-29-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    18

    Adapt CONCATENATE to skip rows

    Hi,

    I'd like to know how adapt the CONCATENATE function to skip rows when copying the formula down a column. For example I am merging rows 3 & 4 using =CONCATENATE(Sheet1!$C3:$AN3,Sheet1!$C4:$AN4) onto Sheet 2 row 3 but it would be very helpful if I could then merge rows 5 & 6 from sheet 1 on row 4 of sheet 2 automatically.

    When I copy the formula down currently sheet 2 cell c4 reads =CONCATENATE(Sheet1!$C4:$AN4,Sheet1!$C5:$AN5)

    Any thoughts?
    Attached Files Attached Files
    Last edited by Celex005; 10-29-2012 at 04:43 PM. Reason: Advised

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

    Re: Concatenate

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


  3. #3
    Registered User
    Join Date
    10-29-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Concatenate

    Thanks for the tip zbor.

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

    Re: Adapt CONCATENATE to skip rows

    Look here lot of snb solutions for CONCENATE http://snb-vba.eu/VBA_UserDefinedFunctions_en.html

  5. #5
    Registered User
    Join Date
    10-29-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Adapt CONCATENATE to skip rows

    Looks like a useful link but I'm not quite ready for visual basic yet and thought the inclusion of the ROW function might work.

    I have experimented with ROW($A$1)+various combinations with the original formula to no avail.

    Any suggestions?

  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,946

    Re: Adapt CONCATENATE to skip rows

    not tested, but maybe combine row() with mod() to only pull in even (or odd) rows?
    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

  7. #7
    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,946

    Re: Adapt CONCATENATE to skip rows

    ok give this a shot...

    =CONCATENATE(INDIRECT("Sheet1!$C"&IF(MOD(ROW(A3),2)<>0,ROW(A3),ROW(A3)+1)&":$AN"&IF(MOD(ROW(A3),2)<>0,ROW(A3),ROW(A3)+1)),Sheet1!$C5:$AN5)

    if it works for the 1st part, modify the 2nd part the same way

  8. #8
    Registered User
    Join Date
    10-29-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Adapt CONCATENATE to skip rows

    Thanks FDibbins, I haven't used the mod function before but it sounds like it has got potential. Do you know how it could be be incorporated into the =CONCATENATE(Sheet1!$C3:$AN3,Sheet1!$C4:$AN4) formula?

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

    Re: Adapt CONCATENATE to skip rows

    Here's another approach - put this formula in C3 of Sheet2:

    =SUMIF(Sheet1!$B$3:$B$12,$B3&"*",Sheet1!C$3:C$12)

    If you don't want to see a zero returned, then you can apply conditional formatting to the cell such that if C3=0 then use a white foreground colour. Then you can copy the formula down and across to get your other values, as in the attached file.

    Hope this helps.

    Pete
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    10-29-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Adapt CONCATENATE to skip rows

    That's great, thanks to both of you.

    I continued to have a play around and managed to come up with a cheat way of avoiding the zero values by adding ascending values to the previously blank cells in column A alongside the table & combining them with FDibbins formula before seeing Pete's post.

    Thanks again!
    Attached Files Attached Files

+ 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