0

Hello All,

I have two columns in Excel Worksheet and want to count column 2 for distinct values in Column 1.

Table:

Column 1 Column 2
Apple Yes
Orange Yes
Apple Yes
Banana No
Grapes No
Banana No
Orange Yes

Desired OUTPUT / RESULT:

Column 1 Column 2
YES 2
NO 2

Please help.

Thank You

3
  • 1
    Yes count should be 2, how it is 3? Commented Jan 28, 2021 at 6:28
  • You are right. my bad. Commented Jan 28, 2021 at 6:52
  • So, try my answer. Commented Jan 28, 2021 at 6:53

1 Answer 1

2

Try below formula-

=SUMPRODUCT(($B$2:$B$8=E2)/COUNTIF($A$2:$A$8,$A$2:$A$8&""))

enter image description here

If you have Excel365 then use below formulas-

E2=UNIQUE(B2:B8)
F2=COUNTA(UNIQUE(FILTER($A$2:$A$8,$B$2:$B$8=E2)))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.