+ Reply to Thread
Results 1 to 9 of 9

Extract data from a vertical list and transform as dataset [second example]

  1. #1
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Extract data from a vertical list and transform as dataset [second example]

    Hello excel friends
    this my second question I need to transform the data set from origial list im colum A into columes C, D as you can see the image that will be my expectes result
    Thank you


    A
    B
    C
    D
    1
    Original Data Expected result
    2
    Employ 1 dog Employ 1
    3
    dog cat Employ 1
    4
    cat armadillo Employ 1
    5
    armadillo badger Employ 2
    6
    Employ 2 bat Employ 2
    7
    badger bear Employ 2
    8
    bat beaver Employ 2
    9
    bear bullock Employ 3
    10
    beaver camel Employ 3
    11
    Employ 3 chimpanzee Employ 3
    12
    bullock dachshund Employ 3
    13
    camel fox Employ 4
    14
    chimpanzee gazelle Employ 4
    15
    dachshund gerbil Employ 4
    16
    Employ 4 giraffe Employ 4
    17
    fox goat Employ 4
    18
    gazelle grizzly bear Employ 4
    19
    gerbil guinea pig Employ 4
    20
    giraffe hamster Employ 4
    21
    goat hare Employ 4
    22
    grizzly bear mammoth Employ 5
    23
    guinea pig marmot Employ 5
    24
    hamster mink Employ 5
    25
    hare mole Employ 5
    26
    Employ 5 mongoose Employ 5
    27
    mammoth mouse Employ 5
    28
    marmot mule Employ 5
    29
    mink
    30
    mole
    31
    mongoose
    32
    mouse
    33
    mule

  2. #2
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Extract data from a vertical list and transform as dataset [second example]

    Here you go...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: Extract data from a vertical list and transform as dataset [second example]

    Hello ¯\_(ツ)_/¯
    this code works fine, but as I told you in topic before, I prefer formula because i'm learning formulas, thank you anyway for your Help
    Please formulas
    Thank You

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

    Re: Extract data from a vertical list and transform as dataset [second example]

    Did you check back to your previous thread to see I posted a formula solution?

    I won't tackle this one until I get some feedback in that thread.

    Pete

  5. #5
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: Extract data from a vertical list and transform as dataset [second example]

    Hello Pete_UK
    as you can see from this image i answered on your Topic, so please can you help me whit this
    Thank you

    \1

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

    Re: Extract data from a vertical list and transform as dataset [second example]

    I got the first part of it (i.e. the animals' names), but I couldn't work out an appropriate way of getting the second column before I went to bed last night. I'm about to go out now for most of the day, but I'll pick this up later if no-one else has chipped in.

    Pete

  7. #7
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: Extract data from a vertical list and transform as dataset [second example]

    Great Thank you Pete

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

    Re: Extract data from a vertical list and transform as dataset [second example]

    This time I needed two helper columns, so I used F and G, with these formulae in the cells stated:

    F2: =IF(A2="","",IF(LEFT(A2,6)="Employ",ROW()-COUNTIF(A$1:A1,"Employ*"),""))

    G2: =IF(A2="","",IF(F2="",MAX(G$1:G1)+1,""))

    Copy these down to at least the bottom row of your data (i.e. to row 33, or beyond). Then you can use this formula in C2 to get the animal:

    =IFERROR(INDEX($A:$A,MATCH(ROWS($1:1),$G:$G,0)),"")

    and this one in D2 to get the employer:

    =IF(ROWS($1:1)>COUNT(G:G),"",INDEX(A:A,MATCH(ROWS($1:2),F:F)))

    Note the first ROWS term has a range of $1:1, whereas the second ROWS term has a range of $1:2. Copy these two down until you start to get blanks. Note that a formula cannot return formatting, so you do not get the colours in column D.

    I'm not too happy with the formula in column F, as it relies on "Employ …" being in the cells, whereas in reality I expect you would have actual names, but it works with the data that you supplied.

    Hope this helps.

    Pete

  9. #9
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: Extract data from a vertical list and transform as dataset [second example]

    Woww
    Works fine, I knew was impossible with single formula, but looks nice to me, now time to study it
    Thank you pete good Job!!
    Solved the problem

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Parsing a horizontal dataset into a ssingle vertical column
    By niggzso in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-12-2016, 03:02 PM
  2. Help on Ideas of how to transform data from a vertical to more horizontal layout
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2016, 03:02 AM
  3. Extract data from a vertical and horizontal Data Table as an Average.
    By Koddy in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 02-15-2015, 04:35 PM
  4. [SOLVED] Converting dataset from vertical to horizontal based on fixed criteria
    By LJH2410 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2014, 10:56 AM
  5. [SOLVED] Vertical chart dataset needs to be converted into pivotable dataset
    By aspak84 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 09-17-2013, 06:06 PM
  6. Extract data from a horizontal range with blanks and create a vertical list
    By dommcg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2013, 10:41 AM
  7. extract data from a matrix dataset in excel
    By vamshi.lucky in forum Excel General
    Replies: 2
    Last Post: 09-12-2011, 07:09 AM

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