pivot table with unique count

it's an excel world

Board Regular
Joined
Sep 17, 2008
Messages
126
Hello all. I know you've probably answered this question a thousand times but when searching I had a hard time finding exactly what I was looking for...
I have a spreadsheet with dates indicated in Column A and order number indicated in Column B. What I need to do is create a pivot table that displays the date with how many different orders shipped that day. Below is an example of my sheet.

Date Order No
1/1/09 123
1/1/09 123
1/1/09 124
1/2/09 123
1/2/09 125
1/2/09 126
1/2/09 126
This is what I would like to see in my pivot table

Date Order No
1/1/09 2
1/2/09 3

I only want each order number counted once within the date range.

thank you!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
5,751
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
In an adjacent empty column that is next to your data, add a header with a name such as "Helper".
In the first row of that Column , enter a formula like

=SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2))=1

Fill the formula down to the end of your data.
Include the new column in your Pivot Table.

If you prefer, Hide the "False" column.
 
Upvote 0

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
try this

Excel Workbook
ABC
1DateOrder NoUnique
21/1/20091231
31/1/20091230
41/1/20091241
51/2/20091231
61/2/20091251
71/2/20091261
81/2/20091260
Sheet2


HTH

edit: too slow, just a little different than Dave Patton's
 
Upvote 0

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Without A Pivot Table (since I can't figure how to do it, LOL)

Your Data including Header in A1:B8
In Cell C2 enter: (and Commit using Ctr+Shift+Enter)
and Copy down...
watch for wrapping of below..


=IF(AND(SUM(--(FREQUENCY(IF($A$2:$A$8=A2,MATCH($B$2:$B$8,$B$2:$B$8,0)),ROW(INDIRECT("1:"&ROWS($B$2:$B$8))))>0))<>C1,$A1<>$A2),SUM(--(FREQUENCY(IF($A$2:$A$8=A2,MATCH($B$2:$B$8,$B$2:$B$8,0)),ROW(INDIRECT("1:"&ROWS($B$2:$B$8))))>0)),"")
 
Upvote 0

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
This thread seems similar to one earlier in the week http://www.mrexcel.com/forum/showthread.php?t=376471. The other thread shows a pivot table solution and also an approach by adding extra columns without using array formulas (they can carry a lot of overhead sometimes). Another way would be a query table with the same SQL as mentioned for the pivot table.

HTH, Fazza
 
Upvote 0

Forum statistics

Threads
1,191,200
Messages
5,985,237
Members
439,953
Latest member
suchitha

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
Top