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.
 
In the above example , IF i select name - GIGI , Start Date & ENd date - 01/25/2010 then I should be able to get unique count as 1 and likewise for the other names, also if i select ALL in names dropdown it should give me all the unique counts
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
First, you would do better to open a new thread. Not everybody is available all the time. Opening a new thread allows more people to see it and try to help.

Next, I don't see a lot of reason to add the employee name to the formula. If you're looking for a count of unique employee names, that automatically limits the result to 1 or 0. So here are two formulas that might do what you want:

Book1 (version 1).xlsb
ABCDEFGH
1
2
3Emp NamesDatesStateActionAccused IDCount Unique
4Gigi25-Jan-10UKTermination111113# of unique names With Termination or Warning letter
5Gigi25-Jan-10UKTermination1111125-Jan-10Start Date Drop Down
6Gigi25-Jan-10UKTermination1111103-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
12Rahul03-Mar-16HKWarning letter573483SGATUL
13Rahul03-Mar-16HKWarning letter573483ALLDON
14Rahul03-Mar-16HKShraddhaGERALL
15Rahul03-Mar-16HKShraddhaGER
16Ashwin03-Mar-16SGShraddhaGER1Including Country/Name
17Ashwin03-Mar-16SGShraddhaGERINDAll
18Atul03-Mar-16AUSShraddhaGER
19Atul03-Mar-16AUSShraddhaGER
20Atul03-Mar-16AUSShraddhaGER
Sheet32
Cell Formulas
RangeFormula
G4G4=SUM(SIGN(FREQUENCY(IF((B4:B20>=G5)*(B4:B20<=G6)*ISNUMBER(MATCH(D4:D20,{"Termination","Warning letter"},0)),MATCH(A4:A20,A4:A20,0)),ROW(A4:A20)-ROW(A2)+1)))
G16G16=SUM(SIGN(FREQUENCY(IF((B4:B20>=G5)*(B4:B20<=G6)*ISNUMBER(MATCH(D4:D20,{"Termination","Warning letter"},0))*((C4:C20=G17)+("all"=G17))*((A4:A20=H17)+("all"=H17)),MATCH(A4:A20,A4:A20,0)),ROW(A4:A20)-ROW(A2)+1)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi Eric,

Thanks a lot , however, I solved this yesterday night coz I had to submit my dashboard today early morning. appreciate your assistance with this matter.
 
Upvote 0

Forum statistics

Threads
1,215,274
Messages
6,123,993
Members
449,137
Latest member
abdahsankhan

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