Merging to formulas

alanhather

New Member
Joined
Feb 2, 2018
Messages
24
Hi,

Im trying to count all the people in on total people column and then trying to count them again but using there ID. But if it comes up twice to count it as 1 in a date range.

Im using a Raw data download of about 4000 records and trying to stay away from an array formula that does work but, it slows down my computer.

here is an example of what im doing.


Raw Data Sample

IDNameDate
A1223BJohn01/01/2017
B112WDavid01/02/2017
A586FDKim02/02/2017
7854SDaniel03/02/2017
14541SCara04/02/2017
A1223BJohn01/01/2017
9S5SJKSDavid01/04/2017
S45S41SKim02/04/2017
S44558SDaniel03/04/2017
A1233ACara01/01/2017
A1223AJohn01/01/2017
8S745S2David02/01/2017
S55S5SSRichard03/01/2017
58S74SSDaniel04/01/2017
A1233ACara01/01/2017

<colgroup><col><col><col></colgroup><tbody>
</tbody>


Result Table

Dates01/01/201731/01/2017
NameTotal PeopleTotal ID
John32
David11
Kim00
Daniel11
Cara21

<colgroup><col><col><col></colgroup><tbody>
</tbody>

Total People Column =COUNTIFS($C$2:$C$16,">="&$F$1,$C$2:$C$16,"<="&$G$1,$B$2:$B$16,E3)

Total ID =SUMPRODUCT(--($C$2:$C$16>=$F$1),--($C$2:$C$16<=$G$1),--($B$2:$B$16=E3),--1/COUNTIF($A$2:$A$16,$A$2:$A$16))

When I use the sum product formula on the big raw data sheet it returns a value of 0. Cant see what is going wrong.

here is a copy of the array formula im using now to achieve this.

=SUM(--(FREQUENCY(IF('Raw Data Prev Year'!$B:$B<>"",IF('Raw Data Prev Year'!$D:$D=A36,IF('Raw Data Prev Year'!S:S>=$B$50,IF('Raw Data Prev Year'!$S:$S<=$C$50,MATCH('Raw Data Prev Year'!$B:$B,'Raw Data Prev Year'!$B:$B,0))))),ROW('Raw Data Prev Year'!$B:$B)-ROW('Raw Data Prev Year'!$B$1)+1)>0))

Many thanks for the help.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,897
Messages
6,122,141
Members
449,066
Latest member
Andyg666

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