+ Reply to Thread
Results 1 to 8 of 8

Grouping data from a colum in another

  1. #1
    Registered User
    Join Date
    06-01-2011
    Location
    Maastricht, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Grouping data from a colum in another

    Dear all,

    I really need your help here!!!

    I have a really close deadline for a university project, involving also the use of an excel sheet to manage a database of around 3000 thousands lines.

    My problem here, is that I would like to group the data of a column (say column A) in another column (say B), under a specific rule.

    An example:

    ..A.....................B
    apple................fruits
    banana.............fruits
    carrot.............vegetables
    mango..............fruits
    salad..............vegetables
    spinach..........vegetables


    Thank you all in advance for your help!!!!!
    Last edited by Albi; 06-01-2011 at 02:30 PM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Grouping data from a colum in another

    Albi,

    Welcome to the Excel Forum.

    We are not here to do your work (or your homework) for you. Before posting a question or request for help, please put in time and effort on the problem yourself.


    Can we see what you have accomplished so far?


    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Grouping data from a colum in another

    Hello Albi,

    Welcome to the Forum!

    You need to provide more information. There are several ways I can think of to solve the problem. Assuming the "rule" is to group the items in column "A" based upon the value in column "B" then you can simply filter the data accordingly. This manual solution can also be be done in code. Is there requirement you use formulas, VBA, or any means possible to solve this problem?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    06-01-2011
    Location
    Maastricht, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Grouping data from a colum in another

    Thank you for the welcome!

    I attach here a cleaned version of the excel sheet.

    Column A shows the data I already have, whereas in column B should appear some 'Groups' (Study Associations in the case) depending on the value in Column A. I compiled the first few lines to give an idea of how it should appear in the end.

    I have already tried to compile column B using a macro triggering different filters. However, I had problems because sometimes it was overwriting values or leaving some blank cells.

    What I need here is some help in writing a macro to compile the whole database.
    Attached Files Attached Files

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Grouping data from a colum in another

    Hello Albi,

    The easiest solution is select column "A" and "B" then sort them by column "B". Do you need to do this in code?

  6. #6
    Registered User
    Join Date
    06-01-2011
    Location
    Maastricht, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Grouping data from a colum in another

    I'm not sure about what you mean.

    Anyway, the code would be really helpful.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Grouping data from a colum in another

    Hello Albi,

    Disregard my last (now deleted). I post a question to you that was for another member. Sory about that.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Grouping data from a colum in another

    Hello Albi,

    Here is the code. this has been added to the attached workbook.
    Please Login or Register  to view this content.
    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