Sep 23 2021 05:49 AM
Hello, I want to track 30-day readmission cases and want to calculate the day difference between the first discharge date (end-date) and readmission date (start date). In the dataset, I have the following variables
A -unique ID code for each person (you will meet this code as many times he/she was admitted);
B - Case ID which is a unique code for each admission (there could be cases when it is the same when referral occurred but such example is not present in this sample dataset)
C-Recieve date
D- Discharge date
I work both on Windows 10 and MacOS big sure 11.6. Excel- 16.53
Sep 23 2021 06:08 AM
See the attached version.
The values in columns C and D were text values, not dates. I used Data > Text to Columns to convert them to dates.
Sep 23 2021 06:09 AM
Solution@Marit585 So i formatted the data as a table and used 'Text to Columns' to force the dates in the date columns to format as dates and not text (maybe your version recognizes them as dates already). Then I created a column that calculates the Time since last Dischaarge using a formula that will filter all the discharge dates based on uniqueID, sort them and find the closest that is less than the receive date and take the difference. Then I created a column that gives a T/F based on it being <=30. It could be done in 1 column but I think that Time since last Discharge could be valuable.
Sep 23 2021 06:58 AM
@mtarler Thank you! much appreciated.
Sep 23 2021 06:09 AM
Solution@Marit585 So i formatted the data as a table and used 'Text to Columns' to force the dates in the date columns to format as dates and not text (maybe your version recognizes them as dates already). Then I created a column that calculates the Time since last Dischaarge using a formula that will filter all the discharge dates based on uniqueID, sort them and find the closest that is less than the receive date and take the difference. Then I created a column that gives a T/F based on it being <=30. It could be done in 1 column but I think that Time since last Discharge could be valuable.