Headcount counting by month

jtbrooklyn

New Member
Joined
May 9, 2013
Messages
6
Hi all,

I am trying to create a headcount file for forecasting in excel. I have a Date of Hire (DOH) and date of termination (DOT). The problem I have is with my "if" formula. Here is what I am trying to do:

If(DOH is < = to (date), DOT = "", DOT > (date), then (1) or "" ). The problem I have is with the DOT being blank and DOT being greater then (date) one is always true? Unless I have a DOT the cell is blank. So even if the termination date is in another month it will always come up blank?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
maybe something like this:

If(AND(DOH<TODAY(), OR(DOT>Today(), DOT=""),1,"")
 
Upvote 0
Thanks for the info but maybe if you see what kind of results I am looking for it may be easier to understand. Here is example: Everything would be driven off of either the DOH or the DOT.

DOH DOT
JanFebMarAprMayJunJulAugSepOctNovDec
1/2/2010111111111111
2/1/201311111111111
1/2/20116/1/2013
11111
1/3/20111/1/2013

<colgroup><col style="width:48pt" span="14" width="64"> </colgroup><tbody>
</tbody>
 
Upvote 0
I would suggest that first you change the headings to dates, and format them with the "Mar-01" format... so where it says "Jan", change that to 01/01/13 and change the format to show "Jan-13"

Then, copy this in for the first formula:
=IF(AND($A2<=C$1,OR($B2="",$B2>C$1)),1,"")

Then copy the cell and paste it in the next cell. Excel will update the formula to fit the next cell.
 
Upvote 0
Okay so I am expanding the method of the file. So I have the first part working for "1" or "", Next I want to be able to calculate the networking days if someone is terminated half way through the month. Below is the out comes I am trying to get. I am having a problem with my networking days. Here is the formula i am using but again I am missing something =IF(OR(G4=1,B4="",OR(B4=H1)),H1,NETWORKDAYS(H2,B4))

Working days 23 20
HCNWDMthly SalHCNWDMthly Sal
DOHDOTDaily rateJan-13Jan-13Jan-13Feb-13Feb-13Feb-13
1/1/2000120.0012327601202400
11/1/20082/15/2013250.0012357501112750
1/2/20111/24/2013350.001186300
1/3/201111/1/2013133.0012330591202660

<colgroup><col style="mso-width-source:userset;mso-width-alt:2486;width:51pt" width="68"> <col style="mso-width-source:userset;mso-width-alt:2742;width:56pt" width="75"> <col style="mso-width-source:userset;mso-width-alt:2486;width:51pt" width="68"> <col style="width:48pt" span="2" width="64"> <col style="mso-width-source:userset;mso-width-alt:2486;width:51pt" width="68"> <col style="width:48pt" span="3" width="64"> </colgroup><tbody>
</tbody>
 
Upvote 0
Not sure what your H2 is, it looks to me like "NWD" is in H2... so if you meant H3, then maybe think of this:
your max net working days are either the total working days, or they are cut short by a DOT..

then take the lesser of either the total working days, or the difference between DOT and the first of the month..
=MIN(H$1,NETWORKDAYS(H$3,B4,))

just in case this ever becomes negative, use 0 instead.. you can use:
=MAX(0,MIN(H$1,NETWORKDAYS(H$3,B4,)))

if you add =IF(OR(G4=1... then you eliminate the negative results, and you won't need the MAX formula..
 
Upvote 0
Thanks again for your help! I think that will work. Here is how the code ended up =IF(B3="",20,MAX(0,MIN(H$1,NETWORKDAYS(H$2,B3,)))), FYI NWD was a heading just for you I did not have it in my file.I added the "" part so that it gives me the MAX if there is no DOT for that month, make sense?
 
Upvote 0
sure... although I think you're adding unnecessary parts to the formula... what if H1 isn't 20? how will this work: =IF(B3="",20...?

also, I think the MIN(H$1,NETWORKDAYS.. takes the lesser of either the days between the two dates, or the 20 days or whatever else is in H1, in other words, the case when it should 20 as an answer is already covered..
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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