I'm sorry this is my first post. Base refers to the earliest and second earliest time points. Sample No is needed because this process will be done for a number of samples. WBC average: I want this variable to average out the earliest and second earliest WBC counts for time points. So for the base time point, I want WBC avg to average out WBC counts of 5/12/2020 17:57:46 (which is 1) AND 5/12/2020 17:58:52 (which is 2) . And WBC average for 8 hour: the average would be 3 + 4 / 2 (3 from 5/13/2020 2:00:48 AND 4 from 5/13/2020 2:01:43) Here is a bigger dataset. And yes, I would need the process for a number of observations. Have: Date Time Sample no. WBC(10^3/uL) 5/2/2020 17:57:46 1a 7 5/2/2020 17:58:52 1a 6 5/3/2020 2:00:48 1a 10 5/3/2020 2:01:43 1a 4 5/3/2020 6:00:41 1a 6 5/3/2020 6:01:34 1a 6 5/3/2020 18:00:46 1a 6.8 5/3/2020 18:01:40 1a 6.91 5/3/2020 18:58:22 1a 6.6 5/3/2020 18:59:15 1a 6.4 WANT Date Time Sample no. WBC(10^3/uL) Average Time Point 5/2/2020 17:57:46 1 7 (7 + 6) / 2 Base 5/2/2020 17:58:52 1 6 -- Base 5/3/2020 2:00:48 1 10 (10+4/2) 8 Hour 5/3/2020 2:01:43 1 4 -- 8 Hour 5/3/2020 6:00:41 1 6 (6+6)/2 12 Hour 5/3/2020 6:01:34 1 6 -- 12 Hour 5/3/2020 18:00:46 1 6.8 (6.8+6.91)/2 24 Hour 5/3/2020 18:01:40 1 6.91 24 Hour 5/3/2020 18:58:22 1 6.6 25 Hour 5/3/2020 18:59:15 1 6.4 25 Hour
... View more