question on selection criteria

selcor

New Member
Joined
Feb 1, 2011
Messages
5
[h=2]Looking for formula to count very specific scenario[/h]
I have a report that i need for the government;
this is a federal low income medical office that has patients coming in thru the year for visits. each visit has a unique visit number in my excel table. A visit may have only one item charged (a procedure) or many (Usually no more than 4 or 6). Each procedure can have up to four diagnoses assigned to it.

So i need to count for example only "Visits" that have a predefined procedure codes; for example codes 99214 or 99212 or 99211; if a visit does not contain one of these values, i should not count it in the report. So a line on the report might ask for # of visits that had a diagnosis of 345.22; so in the example below, the answer would be only 1, only Jane (and count would be 1, because i need to count the number of visits, not procedures).

Or the report might ask for # of visits that had diagnosis code 345.22 or 333.33 (which in this simple data below would be 2, (Jane and Lisa)).

I cant seem to figure out the formula for only counting the UNIQUE NUMBER OF VISITS for a "range" of criteria. Can anyone help?

I can use countifs(D1:D10, "=345.22") for counting all the diagnoses in that column, but i have to select it ONLY if it contains procedure code (99214 or 99212 or 99211) in the procedure code for that visit; AND i can only count it once per visit (in example below JANE has 345.22 on two different lines for one visit, so i can only count it once per visit #)
Thanks in advance.


A B C D E F G
patient uniquevistnumber procedure diag1 diag2 diag3 diag4
Jane 11111 99213 493.2 345.22 333.33 V38.1
Jane 11111 11101 345.22
Bob 22222 99211 555.1 654.1 987.22
Bob 22222 25112 456.78
Mary 33333 99213 493.2 321
Frank 44444 12345 987.65
Lisa 55555 99214 654.32 852.22 333.33 963.12
Lisa 55555 T11023 654.32
Lisa 55555 45678 852.22​
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Build a table
1) Select A1:G10 then CTRL+T
2) Right click in cell A10 and choose add Totals
3) in Cells B11, C11...... select COUNT from the list.
<html><head><title>Excel Jeanie HTML</title></head><body>
<!-- ######### Start Created Html Code To Copy ########## -->
Excel Workbook
ABCDEFG
1patientuniquevistnumberprocedurediag1diag2diag3diag4
2Jane1111199213493.2345.22333.33V38.1
3Jane1111111101345.22
4Bob2222299211555.1654.1987.22
5Bob2222225112456.78
6Mary3333399213493.2321
7Frank4444412345987.65
8Lisa5555599214654.32852.22333.33963.12
9Lisa55555T11023654.32
10Lisa5555545678852.22
11Total99432
Book2

?
?
<!-- ######### End Created Html Code To Copy ########## -->
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

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