Counting unique entries with two given conditions

rogerm

Board Regular
Joined
May 12, 2002
Messages
53
Could anyone help me with the following:

I have three colums of data.

In the first colum I have names
The second Column I have week numbers
And the 3rd column I have dates

I have to report how many dates in ta given week number reports were submitted by each person.

The problem is that on some days more than one report has been submitted so when I count using an array formula such as

=SUM((A2:A10="Name")*(B2:B10="week number")
*C2:C10)
The result is wrong.

I need to count the number of distinct (unique) dates in the date column (c)for a given person on a given date

so I need a combination of

=SUM((A2:A10="Name")*(B2:B10="week number")
to select the ranges together with

=SUM(N(FREQUENCY(C1:A10,C1:C10)>0))

but I'm not sure how to put them together.

to count the unique entries for the range.

Or perhaps there is an easier way or another function I could use.

Any suggestions would be gratefully received.
 
Count Uniques with 2 conditions

Array-enter:

=SUM(IF((A2:A5=E1)*(B2:B5=F1),1/COUNTIF(C2:C5,C2:C5)))

where E1 houses a name and F1 a week number.

To array-enter a formula, hit control+shift+enter at the same time, not just enter.

Aladin

are you sure about this solution?
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
please look at this examplel:
2006_03_07.xls
ABCDEFGH
1
2
3monthdaycarID
4jan111
5jan112
6jan211
7jan211monthjan
8jan212day2
9jan311
10jan3120.452381
11feb111
12feb111
13feb112
14feb212
15feb212
16feb211
17
18
19
sheet1
 
Upvote 0
Re: Count Uniques with 2 conditions

are you sure about this solution?

Since the ID is not unique to the 'Month' and 'Day', try...

=COUNT(1/FREQUENCY(IF(A4:A16=G7,IF(B4:B16=G8,C4:C16)),IF(A4:A16=G7,IF(B4:B16=G8,C4:C16))))

...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!
 
Upvote 0
please look at this examplel:
...

Some options...

[1]

=SUMPRODUCT(--($A$4:$A$16=G7),--($B$4:$B$16=G8),--($C$4:$C$16<>""),--(MATCH($A$4:$A$16&"#"&$B$4:$B$16&"#"&$C$4:$C$16,$A$4:$A$16&"#"&$B$4:$B$16&"#"&$C$4:$C$16,0)=ROW($C$4:$C$16)-ROW($C$4)+1))

[2] if you have the latest version of the morefunc.xll add-in installed:

=COUNTDIFF(IF($A$4:$A$16=G7,IF($B$4:$B$16=G8,$C$4:$C$16&"",""),""),,"")

which needs to be confirmed with control+shift+enter, not just with enter.
 
Upvote 0
Thank you Domenic and Aladin for your kindness
I will check it later

why I can't see the sheet in my msg in this form, and I see instead the script of it?
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

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