Create monthly headcount report

maychui

New Member
Joined
Sep 20, 2015
Messages
8
Hi friends,

I need urgent help in creating a formula for a monthly headcount report. I am able to find a formula suitable for me in an old thread. However, for some reasons, it does not exactly fit my case and I would need help on modifying the formula.
1ABCDEFGHIJKLMNOP
2AliasHidden Zero DateJoin DateLast Date (YTD)Jan-15Feb-15Mar-15Apr-15May-15Jun-15Jul-15Aug-15Sep-15Oct-15Nov-15Dec-15
3Anna026-Sep-1221-Sep-151111111111
4Ben020-Apr-1521-Sep-150000111111

<tbody>
</tbody>

CellFormula
C3=TODAY()
E3=IF(MOD(MATCH(G$1,$D3:$F3),2)=1,"",1)
E4=IF(MOD(MATCH(H$1,$D3:$F3),2)=1,"",1)

<tbody>
</tbody>


The formula in E3, I found it in the old thread.
However e.g. for Ben, he joined on 20-Apr-15, and in my company we will count it as (1) no matter if the join date is in the beginning of the month, middle of the month or end of the month. In Ben's case, his headcount should be counted starting in April instead of May.

Please help! I would like to know how I should modify the formulas in order to calculate the correct headcount. Thank you in advance.

Regards,
May
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi May,

is it possible that you have more understanding of what you want than what you have asked because the above doesn't make much sense. Are your formulas wrong since G$1 is "G" and E3 = a formula that has E3 in it therefore it's a circular reference that is not allowed in Excel.
 
Upvote 0
Hi,
Thanks for your reply. I have made a mistake. Since I extracted this out of a confidential excel, I have edited out some columns and i forgot to change the formulas before pasting them here.
The formulas should be:
E3=IF(MOD(MATCH(E$1,$B3:$D3),2)=1,"",1)
E4=IF(MOD(MATCH(E$1,$B3:$D3),2)=1,"",1)

does this make any sense to you now?

<tbody>
</tbody>
 
Upvote 0
I think I know what your trying to do. If we take your example and assume that "A B C etc." are columns then "Alias" is line 1 etc. so maybe the following formula in E2 (to the right of Anna's YTD) may help?

=IF(AND(E$1>=$C2,E$1<=$D2),1,0)
 
Upvote 0
Apologize for messing up with the columns and rows.
I have already updated the formulas but there is still a problem.
Please see below the result. I am not sure why it does not recognize Eva's headcount. It seems like it only recognizes the headcount when the join date is at the beginning of the month but not the middle of the month. For example, Eva's join date is on 20-April but it is not recognized in April but in May, however for Don, it works fine. Would it possibly be the problem of the formatting of dates?
ABCDEFGHIJKLMNO
1AliasJoin DateLast Date (YTD)Jan-15Feb-15Mar-15Apr-15May-15Jun-15Jul-15Aug-15Sep-15Oct-15Nov-15Dec-15
2Don1-Apr-1521-Sep-15000111111000
3Eva20-Apr-1521-Sep-15000011111000

<tbody>
</tbody>
 
Upvote 0
Then the formula needs to make each person's starting date the 1st so -

=IF(AND(D$1>=DATE(YEAR($B2),MONTH($B2),1),D$1<=$C2),1,0)
 
Upvote 0
Thanks loads. I have added in something to part of the termination date of the formula and it works perfect now.
 
Upvote 0

Forum statistics

Threads
1,214,545
Messages
6,120,128
Members
448,947
Latest member
test111

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