Count Unique Values based on multiple criterias

dellzy

Board Regular
Joined
Apr 24, 2013
Messages
146
Hi Excel Experts,

I found this awesome formula from below URL:-

http://www.mrexcel.com/forum/excel-...e-non-error-non-blank-values-range-cells.html

The contributed formula counts how many unique values in rows and omits errors and blanks. However, this only applicable for one column. What I'm trying to achieve is something extra. I need to calculate how many Users (based on User ID) that access a system on the same date. So, my count must consider the date as well before populates output. Below is my data:-

UserIDDate
V03751X14/3/2016
V03751X15/3/2016
V04046X14/3/2016
V03658X15/3/2016
V03751X14/3/2016
V03752X14/3/2016

<tbody>
</tbody>
So, on date 14/3/2016, the result should be 3 and on 15/3/2016 should be 2.

I tried below, but returned error or '0' :-

=SUM(IF(1-ISERROR($J$16:$J$21),IF($J$16:$J$21<>"",1))/COUNTIFS($K$16:$K$21,$K21,$J$16:$J$21,$J$16:$J$21&""))
with Ctrl+Shift+Enter

=SUM(IF(FREQUENCY(IF(1-ISERROR($J$16:$J$21),IF($J$16:$J$21<>"",AND(MATCH(K16,$K$16:$K$21,0),MATCH("~"&$J$16:$J$21,$J$16:$J$21&"",0)))),ROW($J$16:$J$21)-ROW($J$16)+1),1))
with Ctrl+Shift+Enter

Appreciate your expertise.

Thank you in advance.

DZ
 
Last edited:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,

Please ignore this. Got the solution as below:-


with Ctrl+Shift+Enter


=SUM(IFERROR(IF(1-ISERROR($J$16:$J$21),IF($J$16:$J$21<>"",1))/COUNTIFS($J$16:$J$21,$J$16:$J$21&"",$K$16:$K$21,$K$16:$K$21,$K$16:$K$21,$K16),0))
 
Upvote 0
Hi Dellzy,

simple alternatives, add helper column called checker

userIDDateChecker

<tbody>
</tbody>

Checker :
=if(or(iserror(UserID)=true,isblank(userID)=true), FALSE, TRUE)&Date

for the count :
=countif(Checker, TRUE&yourdate)

thanks
 
Upvote 0
Hi dellzy,

Perhaps you can use something like this.
Mike Szczesny



Excel 2012
ABC
115
2
32
43
51
62
77
8#DIV/0!
98
Sheet1
Cell Formulas
RangeFormula
A8=3/0
C1{=SUM(IF(FREQUENCY(IF(1-ISERROR($A$1:$A$9),IF($A$1:$A$9<>"",MATCH($A$1:$A$9,$A$1:$A$9,0))),ROW($A$1:$A$9)-ROW($A$1)+1),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

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