+ Reply to Thread
Results 1 to 9 of 9

Transforming Data

  1. #1
    Registered User
    Join Date
    01-31-2019
    Location
    Vienna, Austria
    MS-Off Ver
    2010
    Posts
    4

    Transforming Data

    Hi, I'm new to this Forum, I hope you can help me out.

    I have data in the following form: There are patients in the rows, and different Therapies in the columns. in the cells there's the Duration of the therapy in months.

    Patients Therapy 1 Therapy 2 Therapy 3
    p1 10 4 5
    p2 6 8
    p3 9 7

    I'd like to transorm it in a way where I have the Duration in the rows, and the number of patients that have a certain therapy in the cells (in month 0, a certain number of patients is in therapy 1).

    Time Therapy 1 Therapy 2 therapy 3
    Month 0 # of patients
    Month 1
    Month 2

    I've also attached an Excel-file with two worksheets including the examples. Is it possible to transform the data in this way?

    Thanks in advance!
    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,704

    Re: Transforming Data

    You can use this formula in cell B2 of the second sheet:

    =COUNTIF(INDEX(Tabelle1!$B:$D,0,MATCH(B$1,Tabelle1!$B$1:$D$1,0)),SUBSTITUTE($A2,"Month ",""))

    and then copy this across and down as required. See attached file, where you should see the formula translated according to your regional settings.

    Hope this helps.

    Pete
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-31-2019
    Location
    Vienna, Austria
    MS-Off Ver
    2010
    Posts
    4

    Re: Transforming Data

    Thank you for your answer! But I think I didn't explain it properly. I'd like to make sort of a standardized timeline out of the months. Every patient starts therapy 1 at month 0. some stay longer in therapy 1 than others, so the number of patients in therapy one gets lower from month to month. Meanwhile, some patients already start therapy 2, and the number of patients in that line starts getting higher. Is there a way to do this with this data set?

    Thanks again,
    Robert

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

    Re: Transforming Data

    I don't understand. Perhaps you could manually mock up how you would like to see the results and re-attach the file.

    Pete

  5. #5
    Registered User
    Join Date
    01-31-2019
    Location
    Vienna, Austria
    MS-Off Ver
    2010
    Posts
    4

    Re: Transforming Data

    Hey, I uploaded the file. The months should be a timeline in the second table. First, all three patients are in therapy 1. After one Patient goes over to Therapy 2, only 2 remain in the first therapy, and so on
    Attached Files Attached Files

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

    Re: Transforming Data

    Slightly different formulae in columns B, C and D this time - see attached.

    Pete
    Attached Files Attached Files

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Transforming Data

    Please try at B2 drag across and down
    =SUMPRODUCT(--(ROWS(B$2:B2)<=MMULT(N(+Tabelle1!$B$2:B$4),ROW(INDIRECT("1:"&COLUMNS(Tabelle1!$B$2:B$4)))^0)))-SUM($A2:A2)
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-31-2019
    Location
    Vienna, Austria
    MS-Off Ver
    2010
    Posts
    4

    Re: Transforming Data

    Thank you both, it worked!

    Robert

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

    Re: Transforming Data

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Transforming data without Power Query
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2017, 11:16 AM
  2. [SOLVED] Transforming daily data into monthly
    By patafian in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2015, 06:05 AM
  3. Transforming values when there is missing data
    By yanssen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-13-2015, 10:28 AM
  4. Transforming raw data into to meaningful columns
    By naveen_mikki in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-02-2010, 05:36 AM
  5. Transforming data to lie between 0 and 1
    By zgall1 in forum Excel General
    Replies: 2
    Last Post: 03-20-2010, 06:40 PM
  6. transforming raw data to new time format
    By gamuzadt in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 11-16-2009, 11:22 AM
  7. Transforming Data
    By Murtaza in forum Excel General
    Replies: 4
    Last Post: 08-23-2005, 03:05 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