+ Reply to Thread
Results 1 to 11 of 11

Grouping like items together

  1. #1
    Registered User
    Join Date
    04-16-2009
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    4

    Grouping like items together

    I am working on a set of data and need to group items in the same style together. Is there any function can help me?
    Example:
    CODE// CROSS-SELL
    131-A // 131-B, 131-C, 131-D, 131-E
    131-B // 131-A, 131-C, 131-D, 131-E
    131-C // 131-A, 131-B, 131-D, 131-E
    131-D // 131-A, 131-B, 131-C, 131-E
    131-E // 131-A, 131-B, 131-C, 131-D
    133-A //
    133-B //
    133-C //
    133-D //
    133-E //
    134-A //
    134-B //
    134-C //
    134-D //
    134-A //
    135-B //
    135-C //
    135-D //
    135-E //
    135-F //
    Last edited by NBVC; 04-28-2009 at 01:14 PM. Reason: Fix title after 2 day allowance period

  2. #2
    Forum Contributor
    Join Date
    10-11-2007
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    251

    Re: Any Function that helps??

    Can you post an example workbook without sensitive data?

  3. #3
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Any Function that helps??

    Welcome to Excel Forum!, you might want to amend your title as per rule 1, that said, why not use autofilter or do you physicaly want them grouped elsewhere?
    Not all forums are the same - seek and you shall find

  4. #4
    Registered User
    Join Date
    04-16-2009
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Any Function that helps??

    We are selling different colors of T-shirts of same style.
    On our website, we would like to list the alternative colors for our customer to choose from.

    The way I am using is do it manually, copy and paste =.=" Since we have thousand of items, is there any function that can help?

    Thanks for the help!!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-16-2009
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Any Function that helps??

    Quote Originally Posted by Simon Lloyd View Post
    Welcome to Excel Forum!, you might want to amend your title as per rule 1, that said, why not use autofilter or do you physicaly want them grouped elsewhere?
    Hi Simon,

    How can I edit the title?
    I can only edit the content.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Any Function that helps??

    String concatenation is a bit tricky and is not a builtin function to excel, you'll have to add this capability in. I couldn't figure out how to remove the original entry easily, but I was able to use a string concatenation User Defined Function to list all the versions of a single code in one cell.

    Based on your example, all the original codes come BEFORE the hyphen, so I used the hyphen as the break-point to determining which items are "matches" on any given row.

    First, you have to install the StringConcat() function into your spreadsheet:
    1. Open up your workbook.
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given below)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet.
    Here's the code to add:
    Please Login or Register  to view this content.
    Now, there are a LOT of string concatenation UDFs out there, many simpler than this. The benefit of THIS one is that it takes complicated array formulas as a filtering criteria. That's good. On your sheet, in cell B2, this would be the first array formula:

    =stringconcat(",",IF(ISNUMBER(SEARCH(LEFT(A2,FIND("-",A2)-1),$A$2:$A$50)),$A$2:$A$50,""))
    ...confirmed by pressing CTRL-SHIFT-ENTER.

    Curly braces { } will appear around your formula and the first set of comma-delimited string values will appear...all the ones with 131 as the "code".

    The first parameter in red is the "delimiter"..you can make that anything you want. I used a comma.

    The second parameter in blue is the array-filtering criteria, this time in a complicated IF() array.

    Take a look, sorry I couldn't figure out how to NOT list the entry in the CODE column, too, but this at least is usable.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Any Function that helps??

    Quote Originally Posted by lunlum57 View Post
    Hi Simon,

    How can I edit the title?
    I can only edit the content.
    After clicking Edit on your original post, click Go Advanced... and then Edit your title.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  8. #8
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Any Function that helps??

    Quote Originally Posted by NBVC View Post
    After clicking Edit on your original post, click Go Advanced... and then Edit your title.
    NBVC, it's out of the edit time window i think as we only have 2 days to edit our titles/content

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Any Function that helps??

    Quote Originally Posted by Simon Lloyd View Post
    NBVC, it's out of the edit time window i think as we only have 2 days to edit our titles/content
    Thanks Simon.. thought it was a fresh post... anyways, hopefully OP gets the message about thread titles

  10. #10
    Forum Contributor
    Join Date
    10-11-2007
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    251

    Re: Grouping like items together

    See attached workbook
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-16-2009
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Grouping like items together

    Thanks for the help.^^

    I check the spreadsheets attached and it seems complex to me. I need to spend more time in learning these advance function on excel.

+ 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