Count Distinct on Multiple columns with criteria

B0ns41

New Member
Joined
Apr 12, 2018
Messages
6
Hi all,

Hi have a table with three columns, one for names (column A) and the other two for dates (Column B and C). I need to count the distinct dates from column B and C based on criteria on column A.
For example, if the criteria is Paul the result must be 4 (count of distinct dates for this name in both columns, B and C).

How can I do this with formulas?

Thanks.


ABCDEFGH
1NameDate1Date2NameDate1Date2Date1:Date2
2Paul12-01-201812-01-2018Paul234
3Paul12-01-201812-01-2018
4John13-01-201812-01-201812-01-201812-01-201812-01-2018
5Laura13-01-201814-01-201815-01-201816-01-201815-01-2018
6John14-01-201812-01-201817-01-201816-01-2018
7Paul15-01-201816-01-201817-01-2018
8Thomas15-01-201812-01-2018
9Paul15-01-201817-01-2018
10Laura15-01-201818-01-2018

<tbody>
</tbody>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
With the formulas, you can report the number of unique dates for each Name.


Book1
FGH
2234
Sheet58
Cell Formulas
RangeFormula
F2{=SUM(IF(FREQUENCY(IF(A2:A10=E2,B2:B10),IF(A2:A10=E2,B2:B10))>0,1))}
G2{=SUM(IF(FREQUENCY(IF(A2:A10=E2,C2:C10),IF(A2:A10=E2,C2:C10))>0,1))}
H2{=SUM(IF(FREQUENCY(IF(A2:A10=E2,B2:C10),IF(A2:A10=E2,B2:C10))>0,1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
With the formulas, you can report the number of unique dates for each Name.

FGH
2234

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet58

Array Formulas
CellFormula
F2{=SUM(IF(FREQUENCY(IF(A2:A10=E2,B2:B10),IF(A2:A10=E2,B2:B10))>0,1))}
G2{=SUM(IF(FREQUENCY(IF(A2:A10=E2,C2:C10),IF(A2:A10=E2,C2:C10))>0,1))}
H2{=SUM(IF(FREQUENCY(IF(A2:A10=E2,B2:C10),IF(A2:A10=E2,B2:C10))>0,1))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself

<tbody>
</tbody>


What I need is to report the number of unique dates in column B and C as if they were one column (one range), not the the total of unique dates in each column...
 
Upvote 0
What H2 does is report the number of unique dates in columns B and C.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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