I would like to Count values in two columns.

R

Roni

Hello - I am going INSANE for over a month now.... I need to figure out how
to add up this information.

I have one column (Coulmn F) which list Doctors
I have another column (Column D) which list procedures

I need to count how many times each doctor did each type of procedure.

So I THINK I need to add up each occurance of "Dr.Smith" AND "Procedure 1"

Any help would be GREATLY Appreciated!!!! Thanks in advance!

Roni
 
R

Roni

When I do that, I get a "#Num!" error

=SUMPRODUCT(('Dr McNanley'!F:F="Grunert")*('Dr McNanley'!D:D="Vaginal"))
 
D

Dave Peterson

Try limiting your range (F1:F9999, maybe???).

=sumproduct() doesn't like whole columns.
 
R

Roni

Thank you Dave!!!! That worked.... Now next problem...
The doctors are writing "C/S Primary" and "C/S Repeat"
I want it to count any cell that has "C/S" in it....
 
B

Bernie Deitrick

Roni,

Use a pivot table: select the table, and use Data / Pivot table. Then drag 'doctors' to the row
field, 'procedure' to the row field, and 'procedure' to the data fieled, and you will get a table of
doctor/procedure counts.

HTH,
Bernie
MS Excel MVP
 
D

Dave Peterson

=countif(f1:f9999,"c/s*")
for a single count


If it starts with c/s:
=sumproduct(--('dr mcnanley'!d1:d9999="procedure"),
--(left('dr mcnanley'!f1:f9999,3)="c/s"))

if it contains c/s:
=SUMPRODUCT(--('dr mcnanley'!D1:D9999="procedure"),
--(ISNUMBER(SEARCH("c/s",'dr mcnanley'!F1:F9999))))

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html
 
Top