Count unique names in list

[Closed]
Report
-
Hello,

I need to know how to count the number of unique names in a list based off of mulitple conditions. So, i have a sheet of data with mulitple columns(please note that i cannot delete columns or rows, must use data as is in order to allow other formulas to continue working). Lets say:

ColumnA Column B
Market Client
CHS Larry
CHS Bob
CHS Larry
AUG Hillary
AUG Hillary
SAV Bart
SAV Bart
SAV Pat

So i need a formula that will tell me how many unique names are in Column B for a specified market. For example, i need to know that there are 2 unique names in CHS. Every market will have it's own formula.