jeudi 30 juillet 2015

EXCEL: Return a value from table if two criteria are met. One is a date range

Here is my dilemma. I have a column in one table that is blank. to fill it I need to look up user id in another table, and return a value from that table, but if and only if the the date from the 1st table falls within the range of dates from two columns in the 2nd table.

  1. Look up userid in sheet 2
  2. If found look up transdate trans date must fall on or between placefromdt and placetodate
  3. If criteria 1 and 2 met return the value in place

I tried to post pictures of the sheets but I am not authorized. Here is an abbreviated look

UserID      TransDate   Place

93696732A   12/01/2014  
99898585F   12/01/2014  
99898585F   11/01/2014  
91867459C   12/01/2014  
91867459C   11/01/2014  
91867459C   10/01/2014  
91867459C   09/01/2014  
91867459C   08/01/2014  
91867459C   07/01/2014  


userid      station placeid place    placefrmdt  placetodt

E13332190   HW      105612  STJWCC   09/01/2014  02/28/2015
A97059190   HW      105614  TCI      01/01/2014  12/31/9999
A56586039   HW      105614  TCI      01/01/2014  12/31/9999
C02409039   HW      107549  USCEFSGA 12/01/2014  01/31/2015
C67974990   HW      107539  KH       05/01/2015  12/31/9999
C99804409   HW      105612  STJWCC   01/01/2015  04/30/2015
C59064990   HW      105611  SBFHG    08/01/2014  04/30/2015
F09035309   HW      107540  LAC      07/01/2014  12/31/9999
D49047905   HW      105612  STJWCC   10/01/2014  01/31/2015
D13929089   HW      107549  USCEFSGA 09/01/2014  01/31/2015

Aucun commentaire:

Enregistrer un commentaire