The traveling salemen who got sick. Sorting the suspected customers after counting in a pivot table.

Tommy2Tables

New Member
Joined
Sep 16, 2012
Messages
11
The salesmen who visited these customers all got sick. I want to find which are the most common customers in the list. I want to sort the count of how frequently a customer shows up in a COUNT in the Values part of a pivot table, on just the customers' names, then sort that list. But with only one column to sort, the Sort & Filter part of the OPTIONS tab for the pivot table is not available.
I tried to do a previous, non Pivot Table method, of selecting the list, Data, Filter, Advanced Filter, filter in place, unique values only and then put a column next to the filter list like =COUNTIF($B$2:$B$32,B2). That would work and brought the most infected customer, Ines, to the top of my practice list, but in my real data, which is over 100k rows per territory, it crashes, so I hoped to do it with pivot table.

List of customers who were visited by salesmen who got sick Who was visited most often?

<colgroup><col></colgroup><tbody>
</tbody>
CUSTOMERS
James Wheat
Joey Flory
Ross Beckemeyer
Ines Lobaugh
Ines Lobaugh
Brian Matias
Twila Leimbach
Andy Kysar
Ines Lobaugh
Ramona Borges
Belinda Roby
Ines Lobaugh
Ramona Borges
Michael Amato
Ines Lobaugh
Ramona Borges
Ines Lobaugh
Ramona Borges
Bridgett Althaus
Belinda Roby
Ines Lobaugh
Ramona Borges
Bridgett Althaus
Concetta Tasso
Belinda Roby
Ines Lobaugh
Ramona Borges
Stuart Phaup
Willard Bolan
John Gottard

<colgroup><col></colgroup><tbody>
</tbody>

The method of Data Filter Advanced
Filter list in place
Unique records only
gives
CUSTOMERS
James Wheat
Joey Flory
Ross Beckemeyer
Ines Lobaugh
Brian Matias
Twila Leimbach
Andy Kysar
Ramona Borges
Belinda Roby
Michael Amato
Bridgett Althaus
Concetta Tasso
Stuart Phaup
Willard Bolan
John Gottard
and the
=COUNTIF($B$2:$B$32,B2)
gives
1
1
1
8
1
1
1
6
3
1
2
1
1
1
1

<tbody>
</tbody>
which can then be sorted to bring the infectious Inez and Romona to the top,
but this method crashes with big files.

I got help here for a more involved system that I wanted to automatically subtract out discounted the customers who did not make salesmen sick, but the nifty solutions provided by shawnhet and Marcelo Branco were beyond my abilities to understand at this time in my excel development, so I am hoping pivot tables is the way.

Thank you.
Tommy Two Tables


<colgroup><col></colgroup><tbody>
</tbody>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Tommy, yes I think pivot table is the way to go. All you need to do is use the customer list as both the row lables and the values. You can reuse the same field as many times as you like by dragging it from the top in the Field List into the area at the bottom - filter, columns,rows, values.

Row Labels
Count of Customer
Ines Lobaugh
8
Ramona Borges
6
Belinda Roby
3
Bridgett Althaus
2
John Gottard
1
Andy Kysar
1
Brian Matias
1
Michael Amato
1
Concetta Tasso
1
Ross Beckemeyer
1
Stuart Phaup
1
Twila Leimbach
1
Willard Bolan
1
James Wheat
1
Joey Flory
1
Grand Total
30

<tbody>
</tbody>
Debbie S
 
Last edited:
Upvote 0
How did you get the Count of Customers to Sort? I know that you can reuse the field CUSTOMERS in both the PT Row Labels and Values (as Count of CUSTOMERS), but when I try to Sort on the Sort & Filter tab of the Options tab on the ribbon, it is not active. Is the answer that you were able to get the row label for Values to be CUSTOMER instead of CUSTOMERS by typing it into some field address?
Thank you.
 
Upvote 0
Ooops. I got it . In PT I need to pick a value in the Count column, then, sort; outside of Pivot Table, you can pick the whole column. Derp.
I am still getting crashing because of the size of the list. I believe I have removed blank rows from what is being picked for PT. I wonder if I am keeping too much data in the worksheet because of previously deleted rows and columns still being manipulated? How can I make sure that I have completely deleted blank rows and column?
Thank you.
T2T
 
Upvote 0
excel 2010. I got it to run. I don't know if it was deleting excess columns or deleting blank spaces or rebooting the computer, but I have had success. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,930
Members
449,134
Latest member
NickWBA

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