Crafting formula

iphamjames

New Member
Joined
Mar 27, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to create a formula that will be used in a living document that is tracking 30 day readmissions by returning the most recent discharge date within 30 days. I have tried many different variations of formulas but have not been able to find one that works "automatically."

This is for a medical practice and so there are multiple episodes for many unique individuals that have an ID.

One example that I can give is that a person is discharged from a hospital on 12/15/2023 and returns to a hospital on 12/18/2023. Obviously this is a readmission with the returned value of "12/15/2023."

Unfortunately, the formulas I have tried will change the value when the person returns again.

For example:

Episode 1 of person 10: Admission- 12/10/2023 and Discharge- 12/15/2023 No Readmission because this is the fist one.

Episode 2 of person 10: Admission- 12/18/2023 and Discharge- 12/23/2023 Readmission of 12/15/2023

Episode 3 of person 10: Admission- 1/18/2024 and Discharge- 1/30/2024 Readmission of 12/23/2023

This is where my formula would change the outcome of the value for the "Readmission of 12/15/2023" to "Readmission of 12/23/2023" rather than keeping the readmission for episode 2 as 12/15/2023 and the readmission for episode 3 as 12/23/2023.

I would love some help on coming up with a formula on this. It has been very difficult for me.

Thank you!
 

Attachments

  • 30 Day Readmit example.PNG
    30 Day Readmit example.PNG
    22 KB · Views: 8

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
It would be helpful if you can post the sample data using XL2BB.
 
Upvote 0
can you sort the data ??
if you sort by discharge date - then this may work
=IF(MAXIFS($C$1:C1,$A$1:A1,A2)=0,"FV",MAXIFS($C$1:C1,$A$1:A1,A2))

but other members , i'm sure will have better solutions

Book10
ABCD
1IDstartend
2212/1/23FV
3212/5/2312/1/23
4312/10/23FV
5112/15/23FV
6412/20/23FV
7212/20/2312/5/23
8512/21/23FV
9112/23/2312/15/23
1021/1/2412/20/23
1121/1/241/1/24
1231/5/2412/10/23
1331/5/241/5/24
1441/9/2412/20/23
1541/9/241/9/24
1651/13/2412/21/23
1751/13/241/13/24
1811/30/2412/23/23
Sheet1
Cell Formulas
RangeFormula
D2:D18D2=IF(MAXIFS($C$1:C1,$A$1:A1,A2)=0,"FV",MAXIFS($C$1:C1,$A$1:A1,A2))
 
Upvote 0
timers 3 lane.xlsm
ABCDEFG
1IDInOutTypeLOS30 day re-admit
210013/18/20243/20/2024Inpatient3 
310027/18/20237/31/2023Inpatient14 
410028/26/20238/30/2023Inpatient57/31/2023
510029/4/20239/15/2023Inpatient128/30/2023
610029/24/20239/27/2023Inpatient49/15/2023
7100210/6/202310/25/2023Inpatient209/27/2023
810023/1/20243/25/2024Inpatient25 
910031/1/20241/9/2024Inpatient9 
1010043/6/20243/7/2024Observation2 
1110057/8/20237/17/2023Inpatient10 
12100512/11/202312/15/2023Inpatient5 
13100512/18/202312/22/2023Inpatient512/15/2023
1410051/11/20241/18/2024Inpatient812/22/2023
1510052/24/20242/28/2024Inpatient5 
16
Sheet5
Cell Formulas
RangeFormula
F2:F15F2=IF((A2=A1)*(B2-N(C1)<=30),C1,"")
 
Upvote 0
I think the trouble it is still having is that in this example the data ID is in order. If they are jumbled, then the formula does not return the correct value.

any ideas on how this can work when the entries are randomized?
 
Upvote 0

Forum statistics

Threads
1,215,088
Messages
6,123,056
Members
449,091
Latest member
ikke

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