SUMPRODUCT and unique values

gjs1985

New Member
Joined
Feb 2, 2019
Messages
4
Office Version
  1. 2013
Hi,

Please see below a sample fairly basic data set that I am working on:



What I would like to do is return the number of unique values from column b for Susan. By using the SUMPRODUCT formula as shown it results in 5 which is the total number of values but I’m wanting to get it to show the correct number of 3.

I think it may just be a slight variance on the formula that is required and would be grateful for any ideas.

Thanks.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What version of Excel are you using?
Please update your account details to show this, as it affects which functions you can use.
 
Upvote 0
Thanks for that.
How about
+Fluff v2.xlsm
ABCD
1
2SusanASusan3
3JohnE
4SusanB
5SusanC
6PaulF
7SusanA
8JohnG
9SusanC
10
Main
Cell Formulas
RangeFormula
D2D2=SUM(--(FREQUENCY(IF($A$2:$A$9=C2,MATCH($B$2:$B$9,$B$2:$B$9,0)),ROW($B$2:$B$9)-ROW($B$2)+1)>0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Here's an alternative using SUMPRODUCT:
Book1.xlsm
ABCD
2SusanASusan3
3JohnE
4SusanB
5SusanC
6PaulF
7SusanA
8JohnG
9SusanC
Sheet5
Cell Formulas
RangeFormula
D2D2=SUMPRODUCT((B2:B9<>"")*(A2:A9=C2)/COUNTIF(B2:B9,B2:B9&""))
 
Upvote 0

Forum statistics

Threads
1,215,676
Messages
6,126,170
Members
449,296
Latest member
tinneytwin

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