IF Formula

Toastis

Board Regular
Joined
Apr 20, 2011
Messages
65
I have a Hire Date and a Termination Date Column. I need to determine the number of employees that were employed (according to these dates) in January 2011. I will repeat the calculation for Feb, Mar, etc.

The formula would need to include those who may have worked in the month and also been terminated in the same month hired.

Ultimately I need a Starting Headcount for the month and an Ending Headcount for the month.

Those still employed here have a term date of 12/31/2049.

Can anyone help?
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>N</th><th>O</th><th>P</th><th>Q</th><th>R</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Driver ID</td><td style=";">Hire Date Only</td><td style=";">Termination Date</td><td style=";">Jan Start</td><td style=";">Jan End </td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">CAUMO01</td><td style="text-align: right;;">01/24/2011</td><td style="text-align: right;;">01/26/2011</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">ADAJU</td><td style="text-align: right;;">09/16/1996</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">ADABR</td><td style="text-align: right;;">11/07/2005</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">ADAAA</td><td style="text-align: right;;">06/15/2007</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">AGUJO</td><td style="text-align: right;;">08/05/2010</td><td style="text-align: right;;">07/19/2011</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">AGUMA</td><td style="text-align: right;;">09/20/1999</td><td style="text-align: right;;">03/18/2010</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style=";">AGUMI</td><td style="text-align: right;;">07/21/2011</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">AGURO</td><td style="text-align: right;;">08/15/2007</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">AKEHA</td><td style="text-align: right;;">10/11/2002</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">ALLRO</td><td style="text-align: right;;">11/18/1998</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">ALVJO</td><td style="text-align: right;;">04/04/2008</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style=";">ANDGO</td><td style="text-align: right;;">03/09/2007</td><td style="text-align: right;;">05/14/2010</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style=";">ANDJO</td><td style="text-align: right;;">05/22/2006</td><td style="text-align: right;;">04/01/2009</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style=";">ANDMI</td><td style="text-align: right;;">04/03/2000</td><td style="text-align: right;;">02/07/2009</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style=";">ANDRO</td><td style="text-align: right;;">09/15/2007</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">17</td><td style=";">ANTJI</td><td style="text-align: right;;">10/20/2010</td><td style="text-align: right;;">12/31/2049</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br />
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Excel Workbook
NOPQRSTUV
1Driver IDHire Date OnlyTermination Date01-Jan-201131-Jan-201128-Feb-201131-Mar-201130-Apr-201131-May-2011
2CAUMO0124-Jan-201126-Jan-2011010000
3ADAJU16-Sep-199631-Dec-2049111111
4ADABR11-Jul-200531-Dec-2049111111
5ADAAA15-Jun-200731-Dec-2049111111
6AGUJO08-May-201019-Jul-2011111111
7AGUMA20-Sep-199918-Mar-2010000000
8AGUMI21-Jul-201131-Dec-2049000000
9AGURO15-Aug-200731-Dec-2049111111
10AKEHA10-Nov-200231-Dec-2049111111
11ALLRO18-Nov-199831-Dec-2049111111
12ALVJO04-Apr-200831-Dec-2049111111
13ANDGO03-Sep-200714-May-2010000000
14ANDJO22-May-200604-Jan-2009000000
15ANDMI04-Mar-200002-Jul-2009000000
16ANDRO15-Sep-200731-Dec-2049111111
17ANTJI20-Oct-201031-Dec-2049111111
18101110101010
Sheet21
Excel 2010
Cell Formulas
RangeFormula
Q2=IF(AND($O2<=Q$1,$P2>=Q$1),1,0)
R2=IF(AND($O2<=R$1,$P2>=R$1),1,IF(AND(MONTH($P2)=MONTH(R$1),YEAR($P2)=YEAR(R$1)),1,0))


Hi friend:)

By the way this is my worksheet:)
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,517
Members
452,921
Latest member
BBQKING

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