Count Unique Values across multiple columns within a specific Date Range

KlayontKress

Board Regular
Joined
Jan 20, 2016
Messages
67
Office Version
  1. 2016
Platform
  1. Windows
I'm looking for a way to count unique values using criteria in 3 columns (I need to find the unique values comparing all three columns) as well as only counting values between a specific date range. I have a series of formulas to count the number of items in a single column that are between a date range and contain a specific text and I tried to adapt another formula, listed below, to include this date range counting criteria but it doesn't work. When I tried running an error checker, it appears to count the first instance and then stops counting.

The formula I found online to count unique items across criteria in multiple columns is:

Code:
=SUMPRODUCT((1/COUNTIFS(U9:U21,U9:U21,V9:V21,V9:V21,W9:W21,W9:W21)))

I have another formula that counts items across a date range that is also compare multiple criteria:
Code:
=COUNTIFS('Breakdown Data (Don''t Filter)'!$L$2:$L$300000,"*00000*",[COLOR=#ff0000]'Breakdown Data (Don''t Filter)'!$S$2:$S$300000,">="&$B$1,'Breakdown Data (Don''t Filter)'!$S$2:$S$300000,"<="&$B$2[/COLOR],'Breakdown Data (Don''t Filter)'!$F$2:$F$300000,$A8)

I am attempting to use the red text above to modify the formula listed above that to count unique values across 4 columns.



ABCDEFGHI
1NameNumberLetterCodeDateStart Date1/10/18
2
Bob
1
A
ZZ1
1/10/18
End Date1/15/18
3
Bob
1
B
ZZ1
1/10/18
4
Bob
2
A
ZZ1
1/10/18
# of unique items(should be 5 entries, between the date range and across all 4 columns. They are the red text items to the left)
5Bob2AZZ11/11/18
6John1AZZ11/8/18
7
John
2
A
ZZ1
1/13/18
8Susan1AZZ11/8/18
9Susan1BZZ11/9/18
10
Joe
1
A
ZZ1
1/13/18
11Joe1AZZ11/11/18
12Joe2AZZ11/16/18
13
14
15
16
17
18
19

<tbody>
</tbody>

The formula I've tried is:

Code:
=SUMPRODUCT((1/COUNTIFS(A2:A12,A2:A12,B2:B12,B2:B12,C2:C12,C2:C12,D2:D12,D2:D12,E2:E12,">="&$I$1,E2:E12,"<="&$I$2)

The formula returns a #Div/0! error


Does anyone know how to modify the formula to meet the criteria I need?


Thanks in advance for any help you can provide.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How about:

=SUM(SIGN(FREQUENCY(IF(A2:A12<>"",IF(E2:E12>=I1,IF(E2:E12<=I2,MATCH(A2:A12&"|"&B2:B12&"|"&C2:C12&"|"&D2:D12,A2:A12&"|"&B2:B12&"|"&C2:C12&"|"&D2:D12,0)))),ROW(E2:E12)-ROW(E2)+1)))

confirmed with Control+Shift+Enter.
 
Upvote 0
is there a way to modify this to see how many non duplicate items joe has?
 
Upvote 0
nvm. I figured out where to put the if statement to narrow it down to a single person after breaking apart the formula. TY again
 
Upvote 0
How about:

=SUM(SIGN(FREQUENCY(IF(A2:A12<>"",IF(E2:E12>=I1,IF(E2:E12<=I2,MATCH(A2:A12&"|"&B2:B12&"|"&C2:C12&"|"&D2:D12,A2:A12&"|"&B2:B12&"|"&C2:C12&"|"&D2:D12,0)))),ROW(E2:E12)-ROW(E2)+1)))

confirmed with Control+Shift+Enter.
Hi Eric,

I need your help here
I have below columns

1. name of employee
2. Date column
3. Case reference
4. Accused ID ( it can be multiple times)
5. Action column - wherein actions are given like termination, warning letter
6. State name

Now, drop downs as below in my dashboard
1. date - from ( 1/1/2018) to end 1/3/2018
2. Employee name ( drop downs with state names n all )
3. State name ( drop down with state names n all)

I want output like , if suppose I select any employee n give start date n end date then for that specific period for that employee , how many unique employee got termination or warning letter ... this should changed when an user changes dates

pls guide....... I have been trying this since last week but unable to do it
 
Upvote 0
Emp NamesDatesStateActionAccused IDCount Unique
Gigi
25-Jan-10​
UKTermination
11111​
0​
Left side should be answer
Gigi
25-Jan-10​
UKTermination
11111​
25-Feb-11​
Start Date Drop Down
Gigi
25-Jan-10​
UKTermination
11111​
4-Mar-16​
End Date Drop Down
Don
25-Jan-10​
INDTermination
11111​
Don
25-Jan-10​
INDWarning letter
1112​
Country DropdownNames Drop down
Don
25-Jan-10​
INDWarning letter
1112​
UKGIGI
Don
25-Jan-10​
INDWarning letter
1112​
INDRAHUL
Don
25-Jan-10​
INDWarning letter
573483​
AUSASHWIN
Rahul
3-Mar-16​
HKWarning letter
573483​
SGATUL
Rahul
3-Mar-16​
HKWarning letter
573483​
ALLDON
Rahul
3-Mar-16​
HKShraddhaGERALL
Rahul
3-Mar-16​
HKShraddhaGER
Ashwin
3-Mar-16​
SGShraddhaGER
Ashwin
3-Mar-16​
SGShraddhaGER
Atul
3-Mar-16​
AUSShraddhaGER
Atul
3-Mar-16​
AUSShraddhaGER
Atul
3-Mar-16​
AUSShraddhaGER
 
Upvote 0
Eric W.xlsx
ABCDEFGH
2
3Emp NamesDatesStateActionAccused IDCount Unique
4Gigi25-Jan-10UKTermination111110
5Gigi25-Jan-10UKTermination1111125-Feb-11Start Date Drop Down
6Gigi25-Jan-10UKTermination111114-Mar-16End Date Drop Down
7Don25-Jan-10INDTermination11111
8Don25-Jan-10INDWarning letter1112Country DropdownNames Drop down
9Don25-Jan-10INDWarning letter1112UKGIGI
10Don25-Jan-10INDWarning letter1112INDRAHUL
11Don25-Jan-10INDWarning letter573483AUSASHWIN
12Rahul3-Mar-16HKWarning letter573483SGATUL
13Rahul3-Mar-16HKWarning letter573483ALLDON
14Rahul3-Mar-16HKShraddhaGERALL
15Rahul3-Mar-16HKShraddhaGER
16Ashwin3-Mar-16SGShraddhaGER
17Ashwin3-Mar-16SGShraddhaGER
18Atul3-Mar-16AUSShraddhaGER
19Atul3-Mar-16AUSShraddhaGER
20Atul3-Mar-16AUSShraddhaGER
Unique
Cell Formulas
RangeFormula
G4G4=SUM(IF(FREQUENCY(IF(Criteria=$G$7,IF(Criteria2=$G$8,IF(Dates=">="&G5,Dates="<="&G6,MATCH(Names&Dates,Names&Dates,0)))),ROW(Names)-ROW(A4)+1),1))
Press CTRL+SHIFT+ENTER to enter array formulas.
Named Ranges
NameRefers ToCells
Criteria=Unique!$D$4:$D$10G4
Criteria2=Unique!$E$4:$E$10G4
Dates=Unique!$B$4:$B$10G4
Names=Unique!$A$4:$A$10G4
 
Upvote 0
Hi Eric ....Plsssssssssssssssss help ... I am 100% sure that you can help me out with this..

I do not need date to be mentioned in the formulae ., it should be via cell reference coz I am going to change dates very frequently.
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,942
Members
449,134
Latest member
NickWBA

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