Forum Discussion

endelk's avatar
endelk
Regular Visitor
5 years ago
Solved

Countif with multiple filters based on two different tables

Hi,

 

My first time posting here so sorry for any mistakes.

 

I have two tables, one factual with employee movements and their countries on each date and another one with employees' assignments.

 

Table 1 - movements

DateEmployeeMovementCountry
01/01/2012AHireCanada
25/12/2015ATransferUS
01/01/2018ATerminationUS
25/01/2015BHireCanada
03/02/2018BTransferNorway
04/07/2016CTransferBelgium
01/01/2015DTransferNorway

 

Table 2 - assignments

EmployeeAssignment start dateAssignment end dateCoutry of assignment
A01/01/201301/12/2015US
B01/01/201601/01/2018Norway
C01/01/201601/07/2016US
D01/01/201601/01/2017Norway

 

I want to count how many employees were transferred to their countries of assignment after the assignment completed. So, in this case, both employees A and B should be counted:

  • employee A was transferred in 25/12/2015 from Canada to US and his country of assignment was US
  • employee B was transferred in 03/02/2018 from Canada to Norway and his country os assignment was Norway
  • employee C was transferred to Belgium after the end of assignment of in US, so should be disregarded.
  • employee D was transferred before the assignment started, so should be also disregarded.

 

I am kind of stuck here and tried several ways to filter both columns (end date and countries). Any hints?

 

Tks in advance!

 

 

2 Replies

  • gpiero's avatar
    gpiero
    Icon for Skilled Sharer rankSkilled Sharer

    @endelk

    Hello

    is the next useful solution for your need?

    Best regards

    • gpiero's avatar
      gpiero
      Icon for Skilled Sharer rankSkilled Sharer

      endelk 
      Hi,

      if that helps you please mark as solution accepted

      Regards