+ Reply to Thread
Results 1 to 8 of 8

Splitting tables

  1. #1
    Registered User
    Join Date
    05-01-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    5

    Smile Splitting tables

    Hi Excel Forum

    I'm having a problem concerning splitting up cells. On the attached file, there is a short description of my problem as well.

    I have a long sample of stochastic data which I would like to divide into n=2, n=3 or any other number of rows. Is there a function that can do so?
    The question is easier understandable if looking at the data.

    Really hope you can help me!! Google haven't been able to do so..


    Best regards

    Martin
    Attached Files Attached Files

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

    Re: Splitting tables

    I'm just going out now, but I'll get back to you later on if no-one else has (really, just marking this to come back to it).

    Pete

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Splitting tables

    How would you determine if n=2 or n=3?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    05-01-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Splitting tables

    It's a given assignment in statistics.

    n=2 means dividing the first coloumn into 2 observations
    n=3 means diving into 3.

    Example n=2:
    Coloumn B (16,15.9,16,16,16,15)
    .. should be splitted into
    Coloumn D (16,16,16) and Coloumn E (15.9,16,15)

    Example if n=3:
    Coloumn B (16,15.9,16,16,16,15)
    .. should be splitted into
    Coloumn D (16,16) and Coloumn E (15.9,16) and Coloumn F (16,15)


    Looking for a function that can do so..

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Splitting tables

    Hmmm this is an assignment question. Can you show us what progress you have made yourself ?

    When i asked you how do you determine, i meant who gives you the value of N? Is it calculated by any other formula? Or is it given in a message box?

  6. #6
    Registered User
    Join Date
    05-01-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Splitting tables

    Okay, let's take it from scratch..

    Based on an assigment in statistics I am requesting a formula to splitting up the table. I have already shown the method to do the assignment, however what I am asking for is if there is a function in excel, so I won't have to plot all the numbers manually (waste of time).

    The n value I have been talking about indicates the number of observations the sample needs to be separated into. These numbers are given, and is not influenced by any other numbers. Given in a message box..


    Just for clarification - I'm not asking you to do the assignment. I'm simply asking whether there is a function which can plot the numbers, so I don't have to waste time on doing so in the future.
    Parts of the assignment has been attached as well as an updated version, displaying examples of n=2 and n=3.


    Hope someone can/will help!
    Attached Images Attached Images
    Attached Files Attached Files

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Splitting tables

    We can develop a small macro for you if you tell us where we will find the value for n. Or do you want the macro to give a popup asking for the value?

    The reason i asked you about the assignment is - we have seen occurrences where school/college assignments are just put out here and the answers taken from here straight to the teacher, which is not right, isnt it?

  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,731

    Re: Splitting tables

    There isn't just a single function that can do this for you - you will need a combination of functions to compile in a formula which can then be copied across and down to give you the splits you require.

    I would suggest using cell C1 to enable you to select the number of columns you want to split your data into. You could have data validation applied to this cell, such that you can only select from a distinct set of column numbers (2, 3, 4, 5, 6, 10, 12, 15, as suggested in your literature).

    Then in column D you could have a formula which adjusts for the number of rows of data that you will end up with in your split table. For example, put the label "Number" in D1 and this formula in D2:

    =IF((ROW()-1)*$C$1>COUNTA($A:$A),"",ROW()-1)

    Copy this formula down (eg to D40), and then see the effect by choosing different numbers in C1.

    Then you need one formula in E2 which can be copied down and across to give you the split of data that you require. I won't give you this formula per se, but I will indicate to you which functions you will need to make use of, so that you can find out what they do and how you might put them together:

    COLUMNS(...), COUNTA(...), IF(...), INDEX(...), MOD(...), ROW()

    Let us know how you get on.

    Hope this helps.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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