# Formula t count number of employees for each month

1. ## Formula t count number of employees for each month

Hello:

I have payroll info as shown.
I need formula in cell H2 to S2 to give unique employees for given month.

Please let me know if you have any questions.
Thanks.

Riz  Register To Reply

2. ## Re: Formula t count number of employees for each month

Hi - you want to count the number of employees in each month? 36 in Jan, 43 in Feb,etc.  Register To Reply

3. ## Re: Formula t count number of employees for each month

=COUNT(1/FREQUENCY(IF(\$A\$2:\$A\$410>=--(1&H1),IF(\$A\$2:\$A\$410<EDATE(1&H1,1),MATCH(\$B\$2:\$B\$410,\$B\$2:\$B\$410,))),ROW(\$A\$2:\$E\$410)-ROW(\$A\$1)))

or

=COUNT(1/FREQUENCY(IF(\$D\$2:\$D\$410=H1,MATCH(\$B\$2:\$B\$410,\$B\$2:\$B\$410,)),ROW(\$A\$2:\$E\$410)-ROW(\$A\$1)))

Confirm by Ctrl+Shift+Enter

or Normal Enter but calculate slower than FREQUENCY
select H2:S2
enter formula
=SUMPRODUCT((Table1[Month]=H1)/COUNTIFS(Table1[Name],Table1[Name],Table1[Month],Table1[Month]))

Press Ctrl+Enter  Register To Reply

4. ## Re: Formula t count number of employees for each month

Hello Bo_Ry

Very complicated formula but it works

Thanks a lot

Roz  Register To Reply

5. ## Re: Formula t count number of employees for each month

Riz,

Power Query Solution ``Please Login or Register  to view this content.``
Excel 2016 (Windows) 32 bit
A
B
1
Month Total By Month
2
Jan
23
3
Feb
23
4
Mar
25
5
Apr
23
6
May
25
7
Jun
26
8
Jul
26
9
Aug
24
10
Sep
23
 Sheet: Sheet2  Register To Reply