• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Count number of patients receiving same set of exams

deb

New Member
I'm trying to create a formula to calculate the number of patients undergoing the same set of exams.


Example:

Pt ID Exam

A CT abd without contrast

A CT abd with contrast

B CT abd without contrast

C CT head

D CT abd without contrast

D CT abd with contrast


Need to determine how many patient received both CT of Abd without Contrast & CT abd with contrast


Currently using excel 2003
 
Hello deb,


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the three first green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


Now regarding your question, I hope your data ranges from Col A to Col C.


Now at D1 write abd without contrast and E1 write abd with contrast.


Formula at D1 =COUNTIF($C:$C,D1) enter and drag it across to get the count for abd with contrast.


Kaushik
 
Another point, you can use wildcards with COUNTIF. So, if both criteria start with "abd", you could do:

=COUNTIF(C:C,"abd*")
 
Sorry for the delay in Thanking you for your assistance. I think I have figured out how to get the numbers I need.

The countif function gives me the number of time each exam was performed, not necessarily the number of patients that had both exams in the same visit.

I probably did not explain myself very well and my spreadsheet example was messed up as well.

Below is another example with what I have come up with. (As a note, this is not real data therefore no PHI has been compromised

[pre]
Code:
Pt	Exam D/T	Exam	     # f/u 	D/T initial	D/T f/u 	Initial
ID	-	          -  	      exams	exam	        exam	        to f/u
1	10/10/08 15:02	AbdPelvis WO	0	10/10/08 15:02	 	        n/a
2	10/10/08 14:15	AbdPelvis WO	0	10/10/08 14:15	 	        n/a
3	10/10/08 18:21	AbdPelvis WO	0	10/10/08 18:21	 	        n/a
4	10/10/08 18:36	AbdPelvis WO	5	10/10/08 18:36	10/21/08 19:12	264:35
4	10/10/08 18:36	Chest WO 	4 	 	 	                n/a
4	10/10/08 18:36	Head WO	        3 	 	 	                n/a
4	10/16/08 12:45	Head WO	        2 	 	 	                n/a
4	10/21/08 19:11	Chest With	1	 	 	                n/a
4	10/21/08 19:12	AbdPelvis With	0	 	 	                n/a
[/pre]
Initial exam is AbdPelvis WO, Follow-up Exam is AbdPelvis With

As you can see only 1 patient had an AbdPelvis With following an AbdPelvis WO


You can also see that the number of patients with a f/u exam w/i 12 hours is zero.


To simplify my formulas below, I have replaced the cells referencing the exams by the name of the exams.


Column E returns the D/T of the Initial Exam if it matches the criteria

Formula: =IF(COUNTIF($C2,"AbdPelvis WO")=1,$B2,"")


Column F returns the D/T of the Follow-up Exam if it matches the criteria

Formula:IF($C5="AbdPelvis WO",IF($D5<>0,IF(ISERROR(MATCH("AbdPelvis With",$C5:OFFSET($C5,1,0,$D5,1),0)),"",INDEX($B5:OFFSET($B5,1,0,$D5,1),MATCH("AbdPelvis With",$C5:OFFSET($C5,1,0,$D5,1),0))),""),"")


Column G simply subtracts column F from Column E.


I can use other COUNTIF formulas to give me totals of each column


I have little doubt that there is an easier & faster way to get the same results. Any thoughts are appreciated.

I hope this makes sense.


Thanks again for your help.
 
Hell's Bells, I can't get the spreadsheet to come out right. I may have to defer that to my teenage son.


I'm not sure how my children were born with these skills when neither of their parents have them.
 
Back
Top