+ Reply to Thread
Results 1 to 11 of 11

Attempting to flatten multiple temporal data points for single identifier

  1. #1
    Registered User
    Join Date
    10-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    6

    Attempting to flatten multiple temporal data points for single identifier

    Hello, and thanks for anyone taking a look at this. I'm not particularly good with excel, but have some limited knowledge. I am working on a medical research project involving taking information from patients for multiple days. On the first day they come in, the software that I use for data collection will attach all non-temporal characteristics of the patient in numerical form on that same row. Then each additional day the patient is recorded, it only records one number to indicate a single variable (marked level) on the sample attached. What I need to accomplish is to make it so that I can somehow flatten the entry to show only the maximum value for all recorded days in one line so that each patient has only one row. I have attached an excel with what it would look like before and after ideally. Really appreciate if anyone can help me with this!
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Attempting to flatten multiple temporal data points for single identifier

    All the formulas stated below are Array Formulas.

    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

    In A20 Cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =IFERROR(INDEX($A$2:$A$14,MATCH(0,COUNTIF($A$19:$A19,$A$2:$A$14),0)),"")

    Drag it down…

    In B20 Cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =IFERROR(INDEX($B$2:$B$14,LARGE(IF(($A$2:$A$14=$A20),ROW($A$2:$A$14)-MIN(ROW($A$2:$A$14))+1),1)),"")

    Drag it down…

    In C20 Cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =IFERROR(INDEX(D$2:D$14,LARGE(IF(($A$2:$A$14=$A20)*(D$2:D$14<>""),ROW($A$2:$A$14)-MIN(ROW($A$2:$A$14))+1),1)),"")

    Drag it right and down…


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    10-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Attempting to flatten multiple temporal data points for single identifier

    thanks for your help! I am wondering, however, will this equation work for a data set involving 500+ patients? Like an apply automatically to entire sheet method?

  4. #4
    Registered User
    Join Date
    10-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Attempting to flatten multiple temporal data points for single identifier

    Quote Originally Posted by cranialnerve View Post
    thanks for your help! I am wondering, however, will this equation work for a data set involving 500+ patients? Like an apply automatically to entire sheet method?
    Nevermind, I gave this a try and it works great. Thanks!

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Attempting to flatten multiple temporal data points for single identifier

    Glad it helps you and thanks for the feedback and rep

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Registered User
    Join Date
    10-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Attempting to flatten multiple temporal data points for single identifier

    I'm actually having a bit of trouble now. I am getting an incorrect return for my column C level. For example, see below for before/af:

    3 admit_arm_1 5
    3 day_1_arm_1 5
    7 admit_arm_1 5
    7 day_1_arm_1 6
    7 day_2_arm_1 5
    7 day_3_arm_1 5
    7 day_4_arm_1 5
    7 day_5_arm_1 6
    7 day_6_arm_1 5
    7 day_7_arm_1 5
    7 day_8_arm_1 5
    7 day_9_arm_1 5
    8 admit_arm_1 5
    8 day_1_arm_1 5
    8 day_2_arm_1 5
    8 day_3_arm_1 5


    Summarized as:
    3 5
    7 5
    8 5



    As you can see, it is showing 5 for all of them when it really is: 5, 6, 5

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Attempting to flatten multiple temporal data points for single identifier

    Please attach a sample workbook with enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Note: Please don't attach documents containing confidential data like (address, telephone, ID#s, etc.).

  8. #8
    Registered User
    Join Date
    10-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Attempting to flatten multiple temporal data points for single identifier

    ID numbers are fabricated for confidentiality. I included a sample of 5 patients data from rows 1-27. A patient can be enrolled for variable amount of days, but for everyday the patient is enrolled, a new column is created with the same patient identifier but different variable in the C column. What I need to do is flatten it so that I have only 1 row per patient, and that the C column will show only the maximum value attained for that specific patient (regardless of what day it occurred) on that same column. I included a sample starting at row 35. Thanks again!
    Attached Files Attached Files

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Attempting to flatten multiple temporal data points for single identifier

    In A36 Cell - Array Formula - Requires CTRL+SHIFT+ENTER

    =IFERROR(INDEX($A$2:$A$27,MATCH(0,COUNTIF($A$35:A35,$A$2:$A$27),0)),"")

    Below are Normal Formula’s

    In B36 Cell

    =IFERROR(VLOOKUP(A36,$A$2:$B$27,2,FALSE),"")

    In C36 Cell

    =IF(A36<>"",SUMPRODUCT(1*MAX(($A$2:$A$27=A36)*$C$2:$C$27)),"")

    Drag all the formula’s down…

  10. #10
    Registered User
    Join Date
    10-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    6

    Smile Re: Attempting to flatten multiple temporal data points for single identifier

    That did the trick! Very grateful for your help, thanks again!

  11. #11
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Attempting to flatten multiple temporal data points for single identifier

    Glad it helps you and thanks for the feedback

+ 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. Multiple Data Points for a Single Day
    By SheilaV in forum Excel Charting & Pivots
    Replies: 11
    Last Post: 08-20-2019, 02:51 AM
  2. Need macro to search multiple data points from multiple entries and return single value
    By Redbullmoo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2013, 02:16 AM
  3. Lookup multiple data points to find info in a single cell
    By cradams72 in forum Excel General
    Replies: 1
    Last Post: 08-17-2011, 10:51 AM
  4. Evaluate Multiple Data Points Against Single Criteria
    By fmulvaney in forum Excel General
    Replies: 3
    Last Post: 08-31-2010, 03:26 PM
  5. Pie Chart plotting 1 single color for multiple data points
    By moonseed in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-12-2008, 03:41 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