Solved

Findling last date a product was sold in Excel

Posted on 2014-03-28
3
278 Views
Last Modified: 2014-04-08
I have a spreadsheet with about 500K lines that has customer number, product number, invoice date, price, etc. for all products that our company has sold in the past 2 years.  Some products have only been sold one time to a customer but most have been sold many times.

Here is an example:

Cust#	Product#  	Date Sold	Price
5672	100WX202	05/01/13	$155.20
234123	550MP200X20	06/16/12	$12.60
2356	663405T12	01/04/13	$45.60
51190	100WX202	07/11/13	$124.70
5672	100WX202	03/01/14	$142.10
234123	550MP200X20	06/16/14	$12.60

Open in new window

I need a new spreadsheet showing what the last price each customer paid for each product they purchased from us.  Here is what I would need from the above example:

Cust#	Product#  	Date Sold	Price
5672	100WX202	03/01/14	$142.10
234123	550MP200X20	06/16/14	$12.60
51190	100WX202	07/11/13	$124.70

Open in new window


Any help would be appreciated.

Mark
0
Comment
Question by:9thTee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 39962937
In the attached file, I'm taking your data, copying columns A and B to another part of the sheet (or another sheet), use Date\Remove duplicates to only get unique values, then use two array formulas (entered with Ctrl+Shift+Enter instead of Enter) as follows:

for last date
=MAX(($A$2:$A$7=H2)*($B$2:$B$7=I2)*$C$2:$C$7)

for price
=INDEX($D$2:$D$7,MATCH(H2&I2&J2,$A$2:$A$7&$B$2:$B$7&$C$2:$C$7,0))

For 500klines, it's going to get slow though, maybe going through MS Query or a form of database might be a faster bet.
ee-match.xlsx
0
 
LVL 39

Expert Comment

by:nutsch
ID: 39962971
Another option, that might compute faster is to put the following formula in an adjacent column and filter the True values (which are your maximums) to copy to another sheet.

=COUNTIFS($A$2:$A$7,A2,$B$2:$B$7,B2,$C$2:$C$7,">"&C2)=0

Thomas
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39964228
I used a pivot table to get this view of the max dates
Max of Date Sold		
Cust#	Product#  	Total
2356	663405T12	1/4/2013
5672	100WX202	3/1/2014
51190	100WX202	7/11/2013
234123	550MP200X20	6/16/2014

Open in new window

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

762 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