forumula for unique values and countif combined

bkinlic

New Member
Joined
Nov 17, 2014
Messages
3
Hello, Please advise me as I am just learning how to use these functions.

I am trying to use a formula that counts unique text values from this range:(Patient_level!C6:C15000)
while meeting certain criteria ('yes') in this range: Patient_level!I6:I1048576.

I have working formulas for both (separately) but can't figure out how to combine them to sum into one cell..- not sure if I use sum or countif...

My formula for counting unique values:
=SUM(IF(FREQUENCY(IF(LEN(Patient_level!C6:C15000)>0,MATCH(Patient_level!C6:C15000,Patient_level!C6:C15000,0),""), IF(LEN(Patient_level!C6:C15000)>0,MATCH(Patient_level!C6:C15000,Patient_level!C6:C15000,0),""))>0,1))

And my formula for meeting criteria 'Yes':
=COUNTIF(Patient_level!I6:I1048576,"Yes")

Thank you in advance!!!
-B
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
To begin with, you need to use the same size ranges - your countif() is using pretty much an entire column.

Then, I would try to add that into the 1st part of your formula as a test, not a countif...

=SUM(IF(FREQUENCY(IF(LEN(Patient_level!C6:C15000)>0,IF(Patient_level!I6:I15000="Yes",MATCH(Patient_level!C6:C15000,Patient_level!C6:C15000,0),"")), IF(LEN(Patient_level!C6:C15000)>0,MATCH(Patient_level!C6:C15000,Patient_level!C6:C15000,0),""))>0,1))

Untested
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

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