+ Reply to Thread
Results 1 to 5 of 5

Separate data list into 3, depending on the category in column 2

  1. #1
    Registered User
    Join Date
    06-23-2012
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Arrow Separate data list into 3, depending on the category in column 2

    Hi,

    I have a list of data as follows:

    1 X
    2 X
    3 Y
    4 Z
    5 X
    6 X
    7 Y
    8 Y
    9 Z
    10 Y ... and so on...

    In this data, with the help of Excel functions or vba macros, I would like to extract the result as follows:

    1, 2, 5, 6 (This is the list of X category separated by commas)
    3, 7, 8, 10 (This is the list of Y category separated by commas)
    4, 9 (This is the list of Z category separated by commas)


    I created a macro in VB editor for this, but it gives me the result, only if I manually sort the data and enter the range. But I want to automate this process, that in a particular cell when I select one out of these three, i.e. X, Y, or Z, I will automatically get result as stated above. Or these 3 categories can be fixed for 3 cells, fixed to receive the output. Another is the range as has to be dynamic when automating process. As the range can vary from any amount, may 5 may be 5000.

    Can anyone please help me with that.


    Thanks in advance.


    Rohit

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

    Re: Separate data list into 3, depending on the category in column 2

    why in one cell,excel is designed to use one cell for each piece of info.
    "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

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Separate data list into 3, depending on the category in column 2

    Assuming data in Col.A & B
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-23-2012
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Separate data list into 3, depending on the category in column 2

    Hey Jindon,

    You are truly awesome.

    I have been trying to solve this, since few days. But you just simply did it in fraction of an hour.
    I hats off to you buddy. You are super cool.

    Thanks a ton.

  5. #5
    Registered User
    Join Date
    06-23-2012
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Separate data list into 3, depending on the category in column 2

    Hi,

    This has been a really really helpful thing for me.

    I really appreciate if you could just, allow me a quick moment to help in the another instance of the same process.

    The initial step of that is been done now, the other part is as follows:

    In this step now I have the data in rather 3 columns, two are same as before, in the 3rd I have the dates.
    I want the same output, but this time the sorting will be done in 2 levels, first would be the category in column 2, and the next sorting level would be the date in itself.

    I need the same output of the numbers, separated by commas, but this time, should be in order of category and then date in each individual category.


    Thanks a ton for helping.


    YOU'RE Gr8.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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