Same value in one column, then comparing by dates and names in two other columns

FriendshipWaffles

New Member
Joined
Oct 12, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi all -- I am trying to compare the visits for each patient based on the date of service and role listed. More specifically, how many times did a specific physician have a visit with a patient and then refer them to an APC visit (using the date of service as the point of comparison). The Visit Identifier is always a unique value for a specific visit.

In the below screenshot, Dr. A would be counted twice as they saw Patient 1 and that patient had a subsequent APC visit the following month two different times. Dr. C would be counted once as they referred to an APC for Patient 3. However, Dr. A could not count for Patient 3 since their visit was after the APC visit so they did not complete the referral, etc etc. There are 10,000 rows of visits to compare -- some patients are only listed twice, others are listed a dozen times.

Hope that makes sense! I am really struggling so thank you to anyone who can help. (Sorry for the screenshot, work won't allow the Xl2bb add in and mini sheet)


1718904492319.png
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try:
Book1
ABCDEFGHI
1PatientProviderDoctor/Patient123
21Dr. ADr. A200
31APCDr. B000
41Dr. ADr. C001
51APC
61APC
72APC
82APC
92APC
102APC
113Dr. B
123Dr. C
133Dr. C
143APC
153Dr. A
Sheet6
Cell Formulas
RangeFormula
G2:I4G2=COUNTIFS($D$3:$D$15,"APC",$D$2:$D$14,F2:F4,$A$3:$A$15,G1:I1)
Dynamic array formulas.
 
Upvote 0
Hi Cubist -- Thanks for the reply! I am getting a circular reference error and all cells in the new table have a value of 0 except for the very first one which has a 2. Any thoughts on what I might be doing wrong?
 
Upvote 0
Hi Cubist -- Thanks for the reply! I am getting a circular reference error and all cells in the new table have a value of 0 except for the very first one which has a 2. Any thoughts on what I might be doing wrong?
Hard to tell without seeing what you did.
 
Upvote 0

Forum statistics

Threads
1,224,879
Messages
6,181,530
Members
453,054
Latest member
ezzat

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