+ Reply to Thread
Results 1 to 3 of 3

data rearrangement problem

  1. #1
    Registered User
    Join Date
    08-02-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    2

    data rearrangement problem

    Hi all,

    I have a table of data that were generated during a scientific trial. The data describe the time (in days) at which an effect was observed in patients given a drug. My table looks like this:

    Days post administration Number of patients affected
    1 0
    2 1
    3 3
    4 1

    I need to rearrange this data to look at the patients as a population so that I can calculate the mean and standard deviation for the time at which they became affected. So I need a table that looks like this:

    Patient Affected on day
    1 2
    2 3
    3 3
    4 3
    5 4

    Any suggestions on how to perform this rearrangement would be much appreciated. I'm stumped.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: data rearrangement problem

    Not sure how you arrive at your answers, I get this...
    A
    B
    1
    Days Qty
    2
    1
    0
    3
    2
    1
    4
    3
    3
    5
    4
    1
    6
    7
    8
    Pat Aff
    9
    1
    0
    10
    2
    1
    11
    3
    4
    12
    4
    5
    13
    5
    5


    B9=SUMIF($A$2:$A$5,"<="&A9,$B$2:$B$5)
    copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-02-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    2

    Re: data rearrangement problem

    I made the tables in the original post manually as examples. My real data set is obviously somewhat larger.

    It works like this:

    On day 1, 0 patients were affected
    On day 2, 1 patient was affected
    On day 3, 3 patients were affected
    On day 4, 1 patient was affected

    In other words:

    The first patient was affected on day 2
    The second, third and fourth patients were affected on day 3
    The fifth patient was affected on day 4

    There are only five patients and four days in the data set in this example.

    The numbers in column A of my second table are irrelevant. They could just as easily be letters, names or anything else to designate a unique identifier to each patient. E.g.

    patient affected on day
    Bob 2
    Fred 3
    Bill 3
    John 3
    Cletus 4

    It doesn't matter, I just need a list.

+ 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. Data rearrangement
    By akumagaavese in forum Excel General
    Replies: 15
    Last Post: 08-21-2017, 07:06 AM
  2. [SOLVED] Data rearrangement
    By akumagaavese in forum Excel General
    Replies: 3
    Last Post: 08-26-2014, 04:02 PM
  3. Column rearrangement
    By Indi_Ra in forum Excel General
    Replies: 3
    Last Post: 03-07-2013, 05:35 AM
  4. rearrangement of matrix
    By umble in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-03-2012, 12:48 PM
  5. Data Rearrangement
    By nasoor123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2010, 03:02 PM
  6. Simple data rearrangement - hard to code
    By leonnord in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2007, 01:15 PM
  7. data rearrangement...???
    By nkk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2006, 05:30 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