View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default Excel Medical Template Help Needed

With
Col_A contains doctors (A1 is the heading: MD_Name)
Col_B contains patients (B1 is the heading: Patient_ID)
Col_C contains start dates (C1 is the heading: StartDate)
Col_D contains dosage days (D1 is the heading: NumDays)

Try this:
F1: MD
F2: (doctor name to find)

G1: RefDate
G2: (a date)

H1: On RefDate

This formula returns the number of patients, on the
ref date, for that doctor:
H2: =SUMPRODUCT((A2:A20=F2)*($C2:C20<=G$2)*(($C2:C20+$ D2:D20-1)=G$2))

I1: RefDate+30

This ARRAY FORMULA, committed with CTRL+SHIFT+ENTER,
instead of ENTER, returns the max number of patients for that doctor
during the 31 day period beginning on the RefDate:
I2: =MAX(FREQUENCY(IF((A2:A20=F2)*($C2:C20<=TRANSPOSE( G$2+ROW(INDEX(A:A,1):
INDEX(A:A,30))-1))*(($C2:C20+$D2:D20-1)=TRANSPOSE(G$2+ROW(INDEX(A:A,1):
INDEX(A:A,30))-1)),TRANSPOSE(G$2+ROW(INDEX(A:A,1):INDEX(A:A,30))-1)),
TRANSPOSE(G$2+ROW(INDEX(A:A,1):INDEX(A:A,30))-1)))

Adjust range references to suit your situation.

Is that something you can work with?
Post back if you have more questions.

----------------------
Regards,

Ron
Microsoft MVP - Excel

"Doctor Frank" wrote in message
...
Hello, I wonder if you might be able to guide me in the right
direction. I am a physician and need a bit of help. One of the
medications I prescribe is limited to prescribing it to only 100
patients at a time. This number is based on the script activity. For
example if I write for 30 days worth of the medication on January
first,,, that counts as 'one patient' for the next 30 days. If I
write for another patient on January 1st for 15 days worth of the
medication,, then he counts as a hit for the next fifteen days. So,
from the 1st to the 15th,, I will have '2' patients,, then after the
15th, I drop to one patient as the one patients script has expired.
Want to have a simple interface where the Doctor taps his name,,
enters a medical identifier for the patient and taps how long the
script is active for. Then the number of active patients appears in a
box. This is so the doctor does not have any more than 100 patients
active at any one time. One should also be able to type in a date in
the future,, say January 19th in this example,, and get the box to
show that on that date you will only have '1' active patient. Any
guidance would be appreciated,, I am doing this to help a patient
group that is in need,, I have no financial interest in selling this,,
just want to do it to help out. Thanks,,



F. Kunkel, MD