Count Distinct Formula

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I need a formula that can count distinct value for a vendor.
Vendor A1234
Vendor A4563
Vendor BABC
Vendor BDEF
Vendor A1234

in this example I would want to know how many distinct part numbers for Vendor A - so the formula should result in 2 (it should not count the second 1234 for Vendor A

Any help is very much appreciated. Thank you
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
How about
Excel Formula:
=rows(unique(filter(b2:b100,a2:a100="Vendor A")))
 
Upvote 0
Solution
Edit

Fluff has answered

maybe a better way

=COUNTA(UNIQUE(FILTER($B$1:$B$13,$A$1:$A$13=E1)))

Book10
ABCDEF
1Vendor A1234Vendor A2
2Vendor A4563Vendor B3
3Vendor BABC
4Vendor BDEF
5Vendor A1234
6Vendor BDEF
7Vendor Babb
Sheet1
Cell Formulas
RangeFormula
E1:E2E1=UNIQUE(A1:A5)
F1:F2F1=COUNTA(UNIQUE(FILTER($B$1:$B$13,$A$1:$A$13=E1)))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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