Trying to count instances that meet the following criteria: =particular Month, =particular Doctor, =valid patient name. The column with patient name also contains entries such as "Off", "Out", "Break", etc. and these need to be NOT counted in this formula. (But need to stay in the source feed and be counted in a different formula.)
So the initial portion of the formula to count everything that matches the month and the doctor works fine:
=SUM(COUNTIFS(Feed!$P$2:$P$20000,J$1,Feed!$E$2:$E$20000,$A$1))
where A1 holds Dr. Name and J1 holds the current month to be evaluated. This formula results in 1,330, which is the correct number of entries in the raw feed. I need to eliminate those entries that contain things such as "Out", "Break", "Off" etc. which are in the SAME COLUMN as the valid patient name. So, I have been trying things such as:
=SUM(COUNTIFS(Feed!$P$2:$P$20000,J$1,Feed!$E$2:$E$20000,$A$1)-(COUNTIFS(Feed!I2:I20000,{"Out","Break","Off"})))
and the results vary from negative numbers to numbers higher than the original 1,330. I can't even find a pattern to the results I get, since for this particular month there are only 2 "Out" entries for this Dr. but the results go negative. Patient name column is formatted as 'General'. Patient names are actually first name, last initial. (And there isn't anybody named "Out") What am I doing wrong?
So the initial portion of the formula to count everything that matches the month and the doctor works fine:
=SUM(COUNTIFS(Feed!$P$2:$P$20000,J$1,Feed!$E$2:$E$20000,$A$1))
where A1 holds Dr. Name and J1 holds the current month to be evaluated. This formula results in 1,330, which is the correct number of entries in the raw feed. I need to eliminate those entries that contain things such as "Out", "Break", "Off" etc. which are in the SAME COLUMN as the valid patient name. So, I have been trying things such as:
=SUM(COUNTIFS(Feed!$P$2:$P$20000,J$1,Feed!$E$2:$E$20000,$A$1)-(COUNTIFS(Feed!I2:I20000,{"Out","Break","Off"})))
and the results vary from negative numbers to numbers higher than the original 1,330. I can't even find a pattern to the results I get, since for this particular month there are only 2 "Out" entries for this Dr. but the results go negative. Patient name column is formatted as 'General'. Patient names are actually first name, last initial. (And there isn't anybody named "Out") What am I doing wrong?