+ Reply to Thread
Results 1 to 4 of 4

Combine Cells based on column value

Hybrid View

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    8

    Combine Cells based on column value

    Hi,

    I have a document that has Districts in column a along with an overlapping district in Column B. So, if District 1 has 3 overlapping districts, it is in Rows 1, 2 and 3, with the corresponding value in B1, B2, B3. Then, if District 2 has 4 overlapping values, those values are in B4, B5, B6, and B7. I'd like to do some form of conditional concatenate, where I can combine all of the values into one cell for each district, separated by a ";" or some other delimiter. Is there any formula to do this


    Example:
    Base Overlapping District
    1 Ward 1
    1 Ward 2
    1 Ward 3
    1 Ward 4
    1 Ward 5
    1 Ward 6
    2 Ward 5
    2 Ward 6
    2 Ward 7
    2 Ward 8
    2 Ward 9
    2 Ward 10
    3 Ward 9
    3 Ward 11
    3 Ward 12
    3 Ward 13
    3 Ward 14
    3 Ward 15


    I'd like to produce:
    1 Ward 1; Ward 2; Ward 3; Ward 4; Ward 5; Ward 6
    2 Ward 5; Ward 6; Ward 7; Ward 8; Ward 9; Ward 10
    3 Ward 9; Ward 11; Ward 12; Ward 13; Ward 14; Ward 15


    Any thoughts?

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Combine Cells based on column value

    Run the macro ConsolidateMerge on the sheet run macro.

    See the attached file.

    The macro is from JBeaucaire.

    Sub ConsolidateMerge()
    'JBeaucaire  (8/23/2012)
    'Columnar data is Sorted/Matched by column A values, merge column B into a single cell row format
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    08-17-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Combine Cells based on column value

    Exactly what I was looking for. Thanks so much!

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Combine Cells based on column value

    Glad i could help.

    Please mark the question as solved.

+ 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