CountIF based on unique values

wangaa11

New Member
Joined
Feb 28, 2020
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
Hello, I am trying to count the number of times "positive" occurs however the positive could occur duplicate times for a unique value and I only want to count the positive the one time in that instance.



For example and I would attach an actual example but it for whatever reason isn't working so I hope this will do.

H235 Negative
HA260 Negative
H235 Positive
H789 Positive
HA852 Negative
HA951 Negative
HA951 Negative
HA951 Positive
H235 Positive

I should only have 3 "positives" as H235 & HA951 has a duplicate positive

I should note there are over hundreds of rows of data which has a number of unique H values in that first "column" Any assistance on this is greatly appreciated
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,682
Office Version
  1. 365
Platform
  1. Windows
How about
+Fluff v2.xlsm
ABCD
1
2H235Negative3
3HA260Negative
4H235Positive
5H789Positive
6HA852Negative
7HA951Negative
8HA951Negative
9HA951Positive
10H235Positive
11
Master
Cell Formulas
RangeFormula
D2D2=SUM(--(FREQUENCY(IF(B2:B10="Positive",MATCH(A2:A10,A2:A10,0)),ROW(A2:A10)-ROW(A2)+1)>0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 

wangaa11

New Member
Joined
Feb 28, 2020
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
How about
+Fluff v2.xlsm
ABCD
1
2H235Negative3
3HA260Negative
4H235Positive
5H789Positive
6HA852Negative
7HA951Negative
8HA951Negative
9HA951Positive
10H235Positive
11
Master
Cell Formulas
RangeFormula
D2D2=SUM(--(FREQUENCY(IF(B2:B10="Positive",MATCH(A2:A10,A2:A10,0)),ROW(A2:A10)-ROW(A2)+1)>0))
Press CTRL+SHIFT+ENTER to enter array formulas.
thank you for the help however I am still getting a value error and I even used the sample that you provided with the exact same setup and I am getting an error
 

wangaa11

New Member
Joined
Feb 28, 2020
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
How about
+Fluff v2.xlsm
ABCD
1
2H235Negative3
3HA260Negative
4H235Positive
5H789Positive
6HA852Negative
7HA951Negative
8HA951Negative
9HA951Positive
10H235Positive
11
Master
Cell Formulas
RangeFormula
D2D2=SUM(--(FREQUENCY(IF(B2:B10="Positive",MATCH(A2:A10,A2:A10,0)),ROW(A2:A10)-ROW(A2)+1)>0))
Press CTRL+SHIFT+ENTER to enter array formulas.
However what is interesting is if I move the formula down to D4 I get a 1?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,682
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

What error are you getting?
Also did you confirm the formula with Ctrl Shift Enter?
 

wangaa11

New Member
Joined
Feb 28, 2020
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
What error are you getting?
Also did you confirm the formula with Ctrl Shift Enter?
I am getting a #Value! error.

It worked. I did ctrl shift enter incorrectly. It is working now thank you.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,682
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,682
Office Version
  1. 365
Platform
  1. Windows
For future reference
While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered elsewhere.

 

Watch MrExcel Video

Forum statistics

Threads
1,127,898
Messages
5,627,526
Members
416,250
Latest member
darius_rebelo

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
Top