jeudi 18 juin 2015

Excel: comparing two dates with unique customer numbers

Need some help with this logic..

For example:

On my first tab "Last visit", I have columns, "Customer Name", "Customer #" and "Last visit date".

On my second tab, "All visits" I have "Customer Name", "Customer #", and "Visit Dates". Now, this tab shows all of the visit dates (even the last one that is on "Last visit") while the first tab just shows their last visit date.

Goal: On my first tab, "Last Visit", I need some logic that compares the last visit date with all of the visit dates.. for that specific customer ID. So on the next column after "Last visit date" I need the MAX date that specific customer came. So some customers have multiple visits, I need each cell for each customer (over 300 for this store) to read all of the times that they visited and only pull the max (most recent BUT NOT the one that is their last visit) date from the second tab "All visits"

Example: Tab 1:

 Billy Joe    12345     1/02/15       <-- Last visit    new column    --> visit before last visit

 Custmer2      Id2       Date

 Etc

Tab 2:

   Billy Joe    12345     03/15/14

   Billy Joe    12345     04/15/14

   Billy Joe    12345     1/02/15

So I would want the date "04/15/14" and not the other two..

Aucun commentaire:

Enregistrer un commentaire