+ Reply to Thread
Results 1 to 4 of 4

Transpose, Insert Row, VLOOKUP? Desired Data hard to work out...

  1. #1
    Registered User
    Join Date
    06-23-2015
    Location
    Oxnard, California
    MS-Off Ver
    Excel 2007
    Posts
    10

    Transpose, Insert Row, VLOOKUP? Desired Data hard to work out...

    Hello Good People of Excel Forum,

    I've attached two pictures, "CurrentData"
    CurrentData.PNG
    and "DesiredData."
    DesiredData.PNG
    Self explanatory? The problem, in simple words, is that I need to get to a sort of transposed and clean version of the original data (6000 lines).

    The original data is varied so that this formula won't work:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Maybe I missed an obvious way to just transpose and VLOOKUP or copy>paste the data into a workable format, but I haven't come across a quick, macro-finish. My more recent idea was that I could insert blank rows between values in Column A until the total number of rows between each cell with data = a constant. I think 14 rows between each "Customer #" (SAMPLE1 to SAMPLE2) would give me a chance to use the formula from above:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I don't have any idea if or how this could be done. Any ideas would be great. Thanks a bunch.
    Last edited by Overkill; 08-03-2015 at 03:38 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Transpose, Insert Row, VLOOKUP? Desired Data hard to work out...

    Insert a new row 1, with your headers that match the labels in column B (if you need to match them) and in cell D2, enter the formula

    =IF($A2<>"",IF(COUNTIF(OFFSET($A2,0,0,COLUMN(B1),1),"<>")=1,OFFSET($A2,COLUMN(A2),2),""),"")

    and copy to the right for as many columns as you expect the maximum rows per entry.

    Then, for those columns that take their data - in order, and not based on matching the labels - from column B, change the ,2 of the last offset to ,1.

    Then, when you need to match the header, change the formula to this: in this example, the cell is I2 (to do a vlookup based on the label in I1, like PHONE: ) This also assumes PHONE: will be within 14 rows of the label in column A:

    =IF($A2<>"",IF(COUNTIF(OFFSET($A2,0,0,COLUMN(G1),1),"<>")=1,IFERROR(VLOOKUP(I$1,OFFSET($A2,0,1,14,2),2,FALSE),""),""),"")

    Copy that row of formulas down to match your data set, copy all of the columns and paste values over the formulas, and finally sort everything based on column D. And then delete rows where D is blank.
    Last edited by Bernie Deitrick; 08-03-2015 at 05:47 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-23-2015
    Location
    Oxnard, California
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Transpose, Insert Row, VLOOKUP? Desired Data hard to work out...

    Thanks for the response. I will try this after I finish another project and verify if solved. Much appreciated!

  4. #4
    Registered User
    Join Date
    06-23-2015
    Location
    Oxnard, California
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Transpose, Insert Row, VLOOKUP? Desired Data hard to work out...

    Awesome. Solved very quickly with your help. Thanks so much.

+ 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. Insert rows and then transpose data from a horizontal row into a column
    By Winescape in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2014, 11:45 PM
  2. Copy up to blank cell, transpose, and insert rows without overwriting data below
    By scooter7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2013, 10:48 PM
  3. Copy Desired data from one work book to another workbook
    By R_Abhilash in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2013, 02:11 AM
  4. [SOLVED] Insert Rows and Transpose Data
    By sks262 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-10-2012, 01:29 AM
  5. Replies: 0
    Last Post: 02-04-2012, 05:17 AM
  6. Transpose wont work - too much data
    By wibbleman12 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-14-2010, 01:30 PM
  7. i need someone to do all the hard work for me!
    By haplo39 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-21-2007, 08:21 AM
  8. formula won't work unless column of data is a hard number
    By Ron in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2005, 11:06 AM

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