+ Reply to Thread
Results 1 to 3 of 3

Wide to Long Data of Varying Length with No Macros/PivotTable

  1. #1
    Registered User
    Join Date
    07-05-2017
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    5

    Question Wide to Long Data of Varying Length with No Macros/PivotTable

    I'd appreciate if anyone can help with the following problem:

    Original data

    Manufacturer Model 1 Model 2 Model 3 Model 4
    Toyota Corolla Camry 4Runner
    Honda Civic Accord Odyssey CRV

    Reformatted data

    Manufacturer Model
    Toyota Corolla
    Toyota Camry
    Toyota 4Runner
    Honda Civic
    Honda Accord
    Honda Odyssey
    Honda CRV

    How can I make this conversion only by (array) formulas? Also important to note is that not all manufacturers have same number of models. Any help is appreciated!
    Last edited by achpdsee; 07-05-2017 at 07:15 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Wide to Long Data of Varying Length with No Macros/PivotTable

    Hi achpdsee,

    This can be done without VBA with a newer version of Excel. There is a function built into Power Query (an add-in to 2010,2013 Excel) called UnPivot. I've written VBA to do this UnPivot but you don't want that. Sorry but there are now two different ways I know of, neither use Array formulas.

    https://support.office.com/en-us/art...5-f588221c7098
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Wide to Long Data of Varying Length with No Macros/PivotTable

    achpdsee welcome to the forum.

    At this time all I can come up with is an array formula solution. If you don't have thousands of rows/columns of data this might work for you. If are not aware of it array formulas are resource hungry. Too many of them will slow a workbook down.

    In B6 array enter this formula and fill down until you get blanks. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then in A6 enter this non array formula and fill down until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    FWIW the array constant {1;1;1;1} can be made more dynamic with additional functions. I left it this way for simplicity.


    A
    B
    C
    D
    E
    1
    Manufacturer
    Model 1
    Model 2
    Model 3
    Model 4
    2
    Toyota
    Corolla
    Camry
    4Runner
    3
    Honda
    Civic
    Accord
    Odyssey
    CRV
    4
    5
    Manufacturer
    Model
    6
    Toyota
    Corolla
    7
    Toyota
    Camry
    8
    Toyota
    4Runner
    9
    Honda
    Civic
    10
    Honda
    Accord
    11
    Honda
    Odyssey
    12
    Honda
    CRV
    13
    14
    15
    16
    17
    Dave

+ 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] Varying Length Raw Data Import - Find Max Week + 1
    By rjnc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2015, 06:20 PM
  2. [SOLVED] Convert data from wide to long format
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2015, 06:52 PM
  3. Need help converting long data into wide form.
    By gbear in forum Excel General
    Replies: 4
    Last Post: 08-12-2013, 02:21 AM
  4. long to wide transformation of panel data with many variables
    By mradzik79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-05-2012, 02:44 PM
  5. Sum varying length blocks of data
    By meetvivek72 in forum Excel General
    Replies: 3
    Last Post: 08-25-2011, 08:47 AM
  6. Sum varying length blocks of data
    By meetvivek72 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-30-2011, 10:01 AM
  7. perform a calculation on subsets of data of varying length
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2010, 07:58 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