Solved

MS Excel: Lookup First, Last and Second Last Values

Posted on 2015-02-09
2
52 Views
Last Modified: 2015-02-10
Hello,

Seeking your help on some data lookup formulas. Attached is a spreadsheet. I am trying to find the following:

1. Lookup the dataset and return the first purchase date of a given customer
2. Lookup the dataset and return the second last purchase date of a given customer
3. Lookup the dataset and return the last purchase date of a given customer

4. For each of the above dates, also return the name of the sales consultant who the customer was served by.

I've tried a few combinations of min/max and offset/index/match, but I'm a bit out of my depth.

Thanks.
ee-Help.xlsx
0
Comment
Question by:dabug80
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40600125
HI,

pls try

=SMALL(IF(C:C=G5,D:D),1) in H5
=INDEX(E:E,MATCH(G5&H5,C:C&D:D,0)) in I5
=LARGE(IF(C:C=G5,D:D),2) in K5
=+INDEX(E:E,MATCH(G5&K5,C:C&D:D,0)) in L5
=LARGE(IF(C:C=G5,D:D),1) in N5
=INDEX(E:E,MATCH(G5&N5,C:C&D:D,0)) in O5

As array formulas (Ctrl-Shift-Enter)

Regards
ee-HelpV1.xlsx
0
 
LVL 1

Author Closing Comment

by:dabug80
ID: 40601917
This is a top notch solution. Thanks so much. I've been trying to figure it out for ages. I'll have to read up on the small and large worksheet functions. Plus I didn't know you could combined match references like that. You've certainly taught me something. You're a champ.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question