Counting unique data for duplicate customers

chrischew2

New Member
Joined
Aug 5, 2011
Messages
12
Hi there,

I'm new here, but been a huge admirer of this message board for quite a while now. So I'm really hoping someone here can help me with a problem I've been struggling with for a few days now.

Here's my situation: I have a group of salesmen visit dealers several times a month, and I would like to capture and analyse the data from their visits so that I can pivot the database and use it to automatically update some graphs. However, I want each dataset to be unique to each dealer so that it isn't counted everytime the salesman visits the dealer. How do I do this?

Here's a sample of my data (in reality I have about 1000 rows, and columns pulling data across about 15 different fields):

excelproblem.jpg


In the end, the data should translate into a graph that looks like this:

excelproblem2.jpg


Not sure if I've given sufficient info, please let me know if I am omitting something. Thanks a ton in advance!
 
The same layout as before (your bottom tanbe in Sheet 2)
For Avg Competitor sales
=AVERAGE(IF(Sheet1!$B$2:$B$34=Sheet2!$B2,IF(Sheet1!$E$2:$E$34=Sheet2!C$1,Sheet1!$F$2:$F$34),""))
Copy down and accross
But...
For Bob Jones the Average is 70 for C if we take 80 and 60.
How did you arrive at 121?

Not sure about this part

Full Shop Branding

How did you come for 1 Bob Jones ,C?
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Robert,

The 121 comes by summing all the averages of all dealers with C. So by individual dealers (based on my quick averageif formula) it would be:

DEALER 1 - 70
DEALER 2 - 6
DEALER 3 - 6
DEALER 4 - 36
DEALER 5 - 4

Adding it all up, it would be 121.

For full shop branding, the 1 comes because in Bob Jones's case, he only has one dealer (Dealer 1) who registered the full shop branding as C. He also has one for M (Dealer 3), one for D (Dealer 4) and two for O (Dealer 2 and 5). So in total he has visited 5 dealers, so the sum of J32:M32 should be 5. Same applies for the rest.
 
Upvote 0
Hi again,

Is anyone able to help me on my second query about counting unique data that isn't input as 1s and 0s, but as letters or large numbers instead? Would really appreciate any help, thanks.
 
Upvote 0
Hi again,

Is anyone able to help me on my second query about counting unique data that isn't input as 1s and 0s, but as letters or large numbers instead? Would really appreciate any help, thanks.

Would you create a tiny sample along with the desired result for that sample?
 
Upvote 0
Hello,

Sure thing, the following table is a sample of the data:

Excel Workbook
ABCDEFGHI
1Visitation DateSales RepresentativeSales SupervisorDealer NameOverall full shop brandingCompetitor C salesCompetitor O salesCompetitor D salesCompetitor M sales
205/07/2011BOB JONESAGNES COLEDEALER 1C80000
305/07/2011BOB JONESAGNES COLEDEALER 2O7320
405/07/2011BOB JONESAGNES COLEDEALER 3M5200
505/07/2011BOB JONESAGNES COLEDEALER 4D160030
606/07/2011BOB JONESAGNES COLEDEALER 2O00010
706/07/2011BOB JONESAGNES COLEDEALER 3M70200
806/07/2011BOB JONESAGNES COLEDEALER 4D7020100
907/07/2011BOB JONESAGNES COLEDEALER 5O40600
1007/07/2011BOB JONESAGNES COLEDEALER 1C60000
1107/07/2011BOB JONESAGNES COLEDEALER 2O10000
1205/07/2011SAM SMITHAGNES COLEDEALER AC351050
1305/07/2011SAM SMITHAGNES COLEDEALER BO0555
1405/07/2011SAM SMITHAGNES COLEDEALER CC31555
1506/07/2011SAM SMITHAGNES COLEDEALER CC250500
1606/07/2011SAM SMITHAGNES COLEDEALER BO0000
1706/07/2011SAM SMITHAGNES COLEDEALER AC50101030
1806/07/2011SAM SMITHAGNES COLEDEALER DM4000
1907/07/2011SAM SMITHAGNES COLEDEALER EM010300
2007/07/2011SAM SMITHAGNES COLEDEALER BO20020
2107/07/2011SAM SMITHAGNES COLEDEALER CC015100
2207/07/2011SAM SMITHAGNES COLEDEALER AC20101020
2305/07/2011MIKE JAMESAGNES COLEDEALER XC2000
2405/07/2011MIKE JAMESAGNES COLEDEALER YO40500
2505/07/2011MIKE JAMESAGNES COLEDEALER ZC35000
2605/07/2011MIKE JAMESAGNES COLEDEALER WD264000
2705/07/2011MIKE JAMESAGNES COLEDEALER VM604010010
2806/07/2011MIKE JAMESAGNES COLEDEALER XC7080010
2906/07/2011MIKE JAMESAGNES COLEDEALER ZC15020025
3006/07/2011MIKE JAMESAGNES COLEDEALER XC12000
3106/07/2011MIKE JAMESAGNES COLEDEALER UC02000
3207/07/2011MIKE JAMESAGNES COLEDEALER YO20000
3307/07/2011MIKE JAMESAGNES COLEDEALER ZC50000
3407/07/2011MIKE JAMESAGNES COLEDEALER XC5000
3507/07/2011MIKE JAMESAGNES COLEDEALER VM52000
Sheet1


And the following table is the ideal result, which I'd prefer to appear as a pivot, so that users can double click the cells and identify specific dealers:

Excel Workbook
CDEFG
23*Avg Competitor sales
24SALES REPCDMO
25BOB JONES122761842
26MIKE JAMES2135016109
27SAM SMITH49622732
28*****
29*****
30*Full Shop Branding
31SALES REPCDMO
32BOB JONES1112
33MIKE JAMES3111
34SAM SMITH2012
Sheet3


So this means ideally, I'm looking for additional columns to the first table, so I can pivot that table and create the results table, which in turn can be used to generate charts.
 
Upvote 0
Haha sorry, wasn't sure how else to display a proper range of data...

Ok I got 122 for Bob Jones by adding up all the averages of all dealers that he handles in column F. So by individual dealers it would be:

DEALER 1 - 70 ((F2 + F10)/2)
DEALER 2 - 6 ((F3+F6+F11)/3)
DEALER 3 - 6 ((F4+F7)/2)
DEALER 4 - 36 ((F5+F8/2)
DEALER 5 - 4 (F9/1)

Adding it all up, it would be 122.
 
Upvote 0
Unless Aladin will come up with a formula which is adding up 5 Averages without using "+" ,please see attached spreahseet.
This is a work around but it works.
Create a pivot table (column K:O)with averages for all competitors columns:

57309039.jpg



and then use formula in the table.

57309035.jpg

Formula in T2 copy down an accross:
=ROUNDUP(SUM(INDEX(L$1:L$100,MATCH($S2,$K$1:$K$100,0)):INDEX(L$1:L$100,MATCH($S3,$K$1:$K$100,0)-1)),0)

(array enteed confirm CTRL+SHIFT+ENTER)
 
Upvote 0

Forum statistics

Threads
1,225,155
Messages
6,183,212
Members
453,151
Latest member
Lizamaison

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top