Sorting/Counting subject ID's and study time points

crtrftr

New Member
Joined
Jul 18, 2014
Messages
1
Hi everyone!
I need help. I have some data for a study I'm trying to sort according to certain conditions and have no clue how to do it. I have some 940 something subject ID's that were visited for bloodwork at two different time points, 6 months and 18 months. Some ID's were only visited at one or the other time point, but most were visited at both time points. I simply need to know, or sort, or really isolate, the subject ID's according to this: those that were visited at both time points, those at only 6 months, and those at only 18 months. The data below is just a few of those data. The 4 digit number is the ID, the second number is the box it is stored in, the third is the grid position in the box, and the fourth is the time point. I sorted the data according to ID in ascending order to identify duplicates, which will tell me if that ID was visited at both times. I then made a pivot table and organized them by ID and study visit. These are helpful, but I can't figure out how to pull out all the ID's that appear twice, or rather that have both time points, like 1976 or 1977, and put them in their own place so I can identify which will be run through an assay first (we're comparing immunological markers in plasma at different time points, so we need to run the samples at the same time to see a difference).
I'll end up running the samples that were visited only once on their own.
Does this make sense? I can go through and pick out the doubles but I know there's an easier way, I just don't know what it is, and it will help me in the near future.
I can provide the entire set of data if that makes things easier.
Thanks very much!
[TABLE="width: 212"]
<colgroup><col span="4"></colgroup><tbody>[TR]
[TD="align: right"]1970[/TD]
[TD="align: right"]4 [/TD]
[TD] 9,7[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]1976[/TD]
[TD="align: right"]4[/TD]
[TD] 7,3[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]1976[/TD]
[TD="align: right"]4[/TD]
[TD] 7,7[/TD]
[TD] 18[/TD]
[/TR]
[TR]
[TD="align: right"]1977[/TD]
[TD="align: right"]4 [/TD]
[TD] 6,2[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]1977[/TD]
[TD="align: right"]4[/TD]
[TD] 7,1[/TD]
[TD] 18[/TD]
[/TR]
[TR]
[TD="align: right"]1980[/TD]
[TD="align: right"]4 [/TD]
[TD] 9,5[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]1981[/TD]
[TD="align: right"]4[/TD]
[TD] 9,4[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]1984[/TD]
[TD="align: right"]4[/TD]
[TD] 8,8[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]1984[/TD]
[TD="align: right"]4 [/TD]
[TD] 8,6[/TD]
[TD] 18[/TD]
[/TR]
[TR]
[TD="align: right"]1985[/TD]
[TD="align: right"]4[/TD]
[TD] 8,7[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]1985[/TD]
[TD="align: right"]4[/TD]
[TD] 9,3[/TD]
[TD] 18[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Add another column to your data (assume your data is in A2:D12) and enter this formula in E2 and copy down. This gives how many times each ID has been sampled.
=COUNTIF($A$2:$A$12,A2)
Now you can use Auto Filters on your data to filter for 2 in Col E. You could also add Col E to your pivot table and do the filtering there.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top