+ Reply to Thread
Results 1 to 6 of 6

Parse Data from one dimensional array into a 2 dimensional array.

  1. #1
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Parse Data from one dimensional array into a 2 dimensional array.

    OK, Obviously I know the answer to the question, but I would like to see what method other people would use to get the same result. So if you want to answer purely to help, I don't need it as I already have the code to do what I want, I just think that it can be done better and would be interested as to the different angles each person would choose to attack something like this.

    OK, the problem, a simple issue of parsing data.

    I have a one dimensional array in column A with 56 cells of data. The data needs to be broken into a two dimensional array, 14 cells of data over 4 columns alternatively. ie, 1 - 14 in column D, 29 - 42 in column E, 15 - 28 in column F, 43 - 56 in column G, and have this repeated by 5 columns.

    I have attached a file showing the out come of the array.

    Cheers Dave
    Attached Files Attached Files
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    20,029

    Re: Parse Data from one dimensional array into a 2 dimensional array.

    Are the numbers across the top row (1-15) and in the white columns (1-14) generated as part of this, or just there for reference?

    Pete

  3. #3
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Parse Data from one dimensional array into a 2 dimensional array.

    Hey Pete. No, those number are just for reference. Just the yellow filled cells are part of this problem, but there is an empty column every 4th column, hence the 5 column repeat.

    Cheers Dave
    Last edited by JapanDave; 03-28-2016 at 08:38 AM.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    20,029

    Re: Parse Data from one dimensional array into a 2 dimensional array.

    Hi Dave,

    I'm sure you're not really looking for a formula solution, but I thought I've give you one anyway !

    In the attached file I've moved your tables across so that I could put this formula in D2:

    =IF(MOD(COLUMNS($D:D),5)=0,"",INDEX($A:$A,MOD(ROWS($1:1)-1,14)+IF(MOD(COLUMNS($D:D),5)=2,2,IF(MOD(COLUMNS($D:D),5)=3,1,(MOD(COLUMNS($D:D)-1,5))))*14+1))

    This can be copied across to Q2, then D2:Q2 copied down to row 15.

    It would be slightly different if you wanted to see the reference numbers.

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Parse Data from one dimensional array into a 2 dimensional array.

    Hey Pete, Unfortunately it is an array in memory, so that can't be used. And to answer the last question, I don't need to see the reference numbers.

    Thanks for answer though, rep for you.

    Dave

  6. #6
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Parse Data from one dimensional array into a 2 dimensional array.

    No one else? Hmmm

+ 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] Convert one dimensional array into two dimensional array
    By mohammed sabr in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-26-2015, 10:34 AM
  2. Data extraction from two dimensional array
    By Suzerain in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-02-2014, 02:32 AM
  3. Replies: 6
    Last Post: 09-25-2013, 10:08 PM
  4. Load data to two-dimensional array
    By Mr_Knows_Nothing in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-04-2013, 06:58 PM
  5. Creating a 2-dimensional array from a 1-dimensional list
    By guywithcamera in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-27-2008, 06:34 PM
  6. data from 2 dimensional array
    By Pb21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2005, 04:36 PM
  7. Create One-Dimensional Array from Two-Dimensional Array
    By Stratuser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2005, 05:06 PM

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