Case sensitive distinct count based on multiple criteria

kjd513

New Member
Joined
Jun 14, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,
Can you please help me with finding the count of distinct (case sensitive) products sold (Column B) per store (Column C) as per below data? Product_sold column has data from B2: B10. Store column has data from C2:C10. F2:F5 has the resulting expected values that the formula should calculate.
In Column F2, I want a formula which counts the distinct count (case sensitive) of product sold for the store "Costco". The answer should calculate to 2 in F2. Is there a way using SUMPRODUCT and EXACT to calculate distinct count(including case sensitive data) in Column B corresponding to the values in Column C?

I have the below formula which only looks up the range of B2:B10 and counts the occurrences of the value in B2. However, I am not able to expand this formula to make it look for the corresponding values in Column C and then calculate the distinct (case sensitive) count in Column B based on the value from Column C.

=SUMPRODUCT(--EXACT($B$2:$B$10,B2)) --> Is there a way to expand this formula maybe using IF statement and make the formula lookup the range in Column C?






ABCDEF
1
Employee_id

Product_sold

Store

Store

Count of distinct(case sensitive) products sold per store
21ApplesCostcoCostco2
31APPLESCostcoStop and Shop2
42APPLESCostcoTrader Joes1
52orangesStop and ShopAmazon2
62OrangesStop and Shop
72GraPESAmazon
83grapesAmazon
94KiwisTrader Joes
104kiwisAmazon
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Welcome to the Forum!

Try F2: =IFERROR(ROWS(REDUCE(,FILTER(B$2:B$10,C$2:C$10=E2),LAMBDA(a,b,IF(SUM(--EXACT(a,b)),a,VSTACK(a,b))))),"-")
 
Upvote 0
try this:
工作簿1
ABCDEFGHIJ
1Employee_idProduct_soldStoreStoreCount of distinct(case sensitive) products sold per store
21ApplesCostcoCostco222
31APPLESCostcoStop and Shop222
42APPLESCostcoTrader Joes111
52orangesStop and ShopAmazon333
62OrangesStop and Shop
72GraPESAmazon
83grapesAmazon
94KiwisTrader Joes
104kiwisAmazon
11
Sheet1
Cell Formulas
RangeFormula
G2:G5G2=ROWS(UNIQUE(BYROW(EXACT(B$1:B$10,TOROW(B$1:B$10))*(C$1:C$10=E2),CONCAT)))-1
H2:H5H2=ROWS(UNIQUE(BYROW(EXACT(B$1:B$10,TOROW(B$1:B$10))*(C$1:C$10=E2),LAMBDA(x,CONCAT(x)))))-1
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

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