Count unique values that match 2 or more criteria

caeiro01

New Member
Joined
Oct 24, 2015
Messages
7
Hi all,

i need count the number of persons assign to some tasks in one particular day.
Ex. how many persons made the task "a" and "c" on the 24-10-2015?

the answer should be 5

tks
Antonio

nameStatusprocess24-10-201525-10-2015
AnneActuala11
JoeActuala13
MaryActuala
RichardActuala
JoeActuala
MagdalenaActuala1
AnthonyActuala12
AnneActualb11
JoeActualb3
AnneActualb
MaryActualb21
JohnActualb1
MagdalenaActualb31
AnthonyActualb12
AnneActualc33
JoeActualc2
AnneActualc1
MaryActualc3
JohnActualc1
MagdalenaActualc22
AnthonyActualc2

<tbody>
</tbody>
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Welcome to MrExcel...

Assuming your data sits in range A1:E22, try:

Code:
=SUM(IF(FREQUENCY(IF(A2:A22<>"",IF(ISNUMBER(MATCH(C2:C22,{"a","c"},0)),IF(D2:D22>0,MATCH(A2:A22,A2:A22,0)))),ROW(A2:A22)-ROW(A2)+1)>0,1))

Array entered, i.e. with CTRL+SHIFT+ENTER.

The formula uses column D as this is where data for 24/10/2015 exists. It is possible to select multiple columns and add additional functionality into the formula to lookup the column of interest, but I'm unsure whether this is a concern or not for you.

Hope it helps.

Matty
 
Upvote 0
Hi,

why 5 ?
I count only 3 persons that made the task "a" and "c" on the 24-10-2015 : Anne , Joe, Magdalena
 
Upvote 0
Welcome to MrExcel...

Assuming your data sits in range A1:E22, try:

Code:
=SUM(IF(FREQUENCY(IF(A2:A22<>"",IF(ISNUMBER(MATCH(C2:C22,{"a","c"},0)),IF(D2:D22>0,MATCH(A2:A22,A2:A22,0)))),ROW(A2:A22)-ROW(A2)+1)>0,1))

Array entered, i.e. with CTRL+SHIFT+ENTER.

The formula uses column D as this is where data for 24/10/2015 exists. It is possible to select multiple columns and add additional functionality into the formula to lookup the column of interest, but I'm unsure whether this is a concern or not for you.

Hope it helps.

Matty


Hi Matty,

tks, this is brilliant.
However, i'm only missing one thing. I need the formula to select the date column that is mentioned in cell H1 (in this case, is 24/10/2015, but if would be 25/10/2015, the formula shoud search in E2:E22)

tks for the help
Antonio
 
Upvote 0
Try

=SUM(IF(FREQUENCY(IF(A2:A22<>"",IF(ISNUMBER(MATCH(C2:C22,{"a","c"},0)),IF(OFFSET(C2,,MATCH(H1,D1:E1,0),21,)>0,MATCH(A2:A22,A2:A22,0)))),ROW(A2:A22)-ROW(A2)+1)>0,1))
 
Upvote 0
Try

=SUM(IF(FREQUENCY(IF(A2:A22<>"",IF(ISNUMBER(MATCH(C2:C22,{"a","c"},0)),IF(OFFSET(C2,,MATCH(H1,D1:E1,0),21,)>0,MATCH(A2:A22,A2:A22,0)))),ROW(A2:A22)-ROW(A2)+1)>0,1))

Hi gaz_chops

in the offset, why did you chose C2?

i'm having some erros in some queries. is there any other option?

tks
 
Upvote 0
C2 is the start point for the offset, match will return 1 for the 24/10/15 or 2 for the 25/10/15, it will then reference either D2 or E2 (1 or 2 columns from C2), the 21 tells it to use 21 rows.

What are your data ranges? Post the actual formula you are using.
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

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