Jun 29 2021 01:32 PM
I have a dataset as below to find the count of employees.
Possible scenario: The employee has joined as contractor and was terminated. Then Emp A is rehired as Full time.
Expected Headcount for the month of 01/31/2020: Emp A Contractor and Emp B
Can anybody help formulating the logic to calculate monthly headcount?
EMPLID | ACTION_DT | Effective Date | Record Date | Record Type | PS_Hire Date (from Legacy System) | WD_Hire_Date | WD_Original_Hire_Date | WD_Termination date | WD_Contract_End_Date |
A (Full time) | 4/2/2019 | 4/8/2019 | 1/31/2020 | Snapshot | 4/8/2019 | 4/6/2021 | 4/6/2021 | ||
B | 10/9/2019 | 10/15/2019 | 1/31/2020 | Snapshot | 10/15/2019 | 4/13/2020 | 4/13/2020 | 6/30/2020 | 6/30/2020 |
A Contractor (Contract Ended) | 4/2/2019 | 4/8/2019 | 1/31/2020 | Snapshot | 4/8/2019 | 4/8/2019 | 4/8/2019 | 4/4/2021 | 4/4/2021 |
Jun 30 2021 10:21 AM
Hello @GayathriSK,
Perhaps this is what you're after?
=SUM(
COUNTIFS($I$2:$I$4,">"&TODAY(),$H$2:$H$4,"<="&TODAY()),
COUNTIFS($I$2:$I$4,"",$H$2:$H$4,"<="&TODAY())
)
Where WD_Termination date = $I$2:$I$4 and WD_Original_Hire_Date = $H$2:$H$4.
Jun 30 2021 12:02 PM