Find each customer's second order date in a li

2019-09-22 01:41发布

问题:

I have a list of all orders placed in a time range and I am trying to calculate the difference between each customer's first and second order. I have a list of unique customer IDs on another tab and I already have the first order date for each. I need a way to grab the date of the second order, corresponding to each customer ID.

In the sample data below, the correct output of this formula for customer ID "153950" would be "5/11/17 8:41".

回答1:

Use AGGREGATE()

=AGGREGATE(15,6,Sheet1!C1:C4/(Sheet1!A1:A4 = 153950),2)

The ,2 is grabbing the second smallest date.