+ Reply to Thread
Results 1 to 4 of 4

How to group data?

  1. #1
    Registered User
    Join Date
    10-13-2016
    Location
    DK
    MS-Off Ver
    2016
    Posts
    2

    Question How to group data?

    Hi,

    I have a coulmn of +60 data points (a sampling of weight over time) and would like to create samples of 2,3,4....,10 data points for further calculations. Basically a matrix consisting of sample y and sizes x. Now, I've tried using the data analysis toolpack, but periodic sampling only sample the datapoint at each period and not a group as I would like. In genereal, I've tried many approaches, but no one seems to fit. More specific, I would like to do the following:

    Coulmn of samples -> Group into samples of size x -> convert into row, showing the grouped sample 1 consisting of the x datapoints, sample 2 consisting of the x datapoints....... sample y consisting of x datapoints.

    So for example, if I have a column of 60 samples I would like to sort them into groups of 2,3,4...10 going up from sample 1-60. For group size = 3 I would get 20 groups of samples and for 10, 6 groups with 10 samples. How to do this in an automated way rather than manually copy-paste-transpose the data?
    Last edited by rosn; 10-13-2016 at 08:08 AM.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: How to group data?

    Perhaps if you could attach a sample workbook showing your desired results it would help is to provide you with a solution.

    BSB

  3. #3
    Registered User
    Join Date
    10-13-2016
    Location
    DK
    MS-Off Ver
    2016
    Posts
    2

    Re: How to group data?

    Sample.xlsx

    Okay. So what I need is some code that could help me do this, so that I in theory could generate groups of samples from my data in every size I'd want to, eg. 1,2,3....N.
    I've tried with transpose, index and indirect withouth any luck. Maybe I did it wrong I don't know.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: How to group data?

    Would a VBA approach to this work for you?

    Click the button in the attached (on the "Data" sheet) and enter the required number of observations in the dialog box that appears.
    Click OK and a new sheet will be created and lay out the data as per your examples.

    Hope that's of use to you.

    BSB
    Attached Files Attached Files

+ 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] Selecting a group of data from a larger group
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2016, 08:23 PM
  2. Replies: 3
    Last Post: 05-22-2016, 06:30 AM
  3. group matching and insert group of relevant data
    By kitkitkat430 in forum Excel General
    Replies: 1
    Last Post: 10-27-2015, 04:03 AM
  4. Replies: 1
    Last Post: 02-10-2014, 10:26 PM
  5. Replies: 0
    Last Post: 02-04-2013, 03:25 PM
  6. Replies: 2
    Last Post: 01-18-2013, 12:45 PM
  7. Replies: 5
    Last Post: 01-16-2013, 12:33 PM

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