Solved

Index with sum Formula

Posted on 2013-06-18
2
323 Views
Last Modified: 2013-06-19
I need to identify the top 10 customers for a selected item. My spreadsheet where I store all the data has individual rows for each sale of my items. There are multiple customers throughout the data. I need to be able to select an item and then have it list the top 10 customers based on sales $$$ for that item. Then I need to also sum up the total quantity sold for those customers for the item selected as well. There can be multiple lines for a customer so I need to sum up all the sales and then show the top 10 customers.

Columns used:

Customer Name  = D
Sales $$$ = V
Item # = I
Quantity = AZ

On a separate worksheet I will enter the item # in cell W3 and then I want the top 10 customers to be listed in row 7 thru 16 starting in column W. The sales $$$ in column X, and the quantity in column Y.

Any ideas? I know a pivot table would work best but I don't want to use those in this file.
0
Comment
Question by:Lawrence Salvucci
2 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39258257
You would be much better off with a PivotTable--especially if you have a lot of data.

I used an auxiliary column that added up the sales $$$ for the customer & item, but only displayed that total on the first mention. For all other occurrences of that customer & item, the formula returns 0. I put this formula in column BB of Sheet1, but it could go on Sheet2 if you prefer.
=IF(COUNTIFS(D$2:D2,D2,I$2:I2,I2)=1,SUMIFS(V$2:V$150,D$2:D$150,D2,I$2:I$150,I2),0)

On Sheet2, I could then use this array-entered formula to return the biggest customer:
=IF(LARGE((Sheet1!I$2:I$150=W$3)*Sheet1!BB$2:BB$150,ROWS(W$7:W7))=0,"",INDEX(Sheet1!D$2:D$150,MATCH(LARGE((Sheet1!I$2:I$150=W$3)*Sheet1!BB$2:BB$150+ROW(Sheet1!D$2:D$150)/10000,ROWS(W$7:W7)),(Sheet1!I$2:I$150=W$3)*Sheet1!BB$2:BB$150+ROW(Sheet1!D$2:D$150)/10000,0)))

And to return the $$$ and quantity, these regular formulas:
=IF(W7="","",SUMIFS(Sheet1!V$2:V$150,Sheet1!D$2:D$150,W7,Sheet1!I$2:I$150,W$3))
=IF(W7="","",SUMIFS(Sheet1!AZ$2:AZ$150,Sheet1!D$2:D$150,W7,Sheet1!I$2:I$150,W$3))

In these formulas, the references to row 150 is arbitrary, and may extend beyond your data. Don't use the entire column if you value your recalc time, however.

The reference to ROW(Sheet1!D$2:D$150)/10000 is to break a tie in the sales $$$.
BiggestCustomersQ28161125.xlsx
0
 
LVL 1

Author Closing Comment

by:Lawrence Salvucci
ID: 39258978
Thank you for all your help. I greatly appreciate it! This is exactly what I was looking for. Perhaps on future projects I can incorporate pivot tables.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
how to reset cell styles? 15 26
Excel 2007 Macro to Change Column Formatting 3 34
Turn date into age 17 33
best way to protect an excel questionnaire 5 30
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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