Counting unique values in date range

magnus101

New Member
Joined
Apr 11, 2012
Messages
36
Hello,
I am trying to count unique values in a date range.
I found this great sample:
How to count unique distinct records in a date range | Get Digital Help - Microsoft Excel resource

However my date range comes from a pivot table grouped by 7 days.

So my data is like:

Date, Item

then I put this into a pivot table. With the date having a 7 day grouping.

So my dates are like

1/9/2012 - 1/15/2012
1/16/2012 - 1/22/2012

<colgroup><col style="mso-width-source:userset;mso-width-alt:5851;width:120pt" width="160"> </colgroup><tbody>
</tbody>


Is there an easy way of putting that date range into the formula from the solution page posted above?
Or better yet,
Is there a way to have the pivot table count unique values right in itself?
Maybe by adding a calculated field?

thanks
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hello,
I am trying to count unique values in a date range.
I found this great sample:
How to count unique distinct records in a date range | Get Digital Help - Microsoft Excel resource

However my date range comes from a pivot table grouped by 7 days.

So my data is like:

Date, Item

then I put this into a pivot table. With the date having a 7 day grouping.

So my dates are like

1/9/2012 - 1/15/2012
1/16/2012 - 1/22/2012

<tbody>
</tbody>


Is there an easy way of putting that date range into the formula from the solution page posted above?
Or better yet,
Is there a way to have the pivot table count unique values right in itself?
Maybe by adding a calculated field?

thanks

Are you trying to count distinct dates, i.e., determine the number distinct/unique dates? If so, you could use directly the source data.
 
Upvote 0
Or better yet,
Is there a way to have the pivot table count unique values right in itself?
Maybe by adding a calculated field?

thanks
Hi,

You can't do it directly in a traditional PivotTable - but you can do it indirectly by adding a unique count helper column in your source data. The easiest method however may be to use a PowerPivot measure for Excel 2010+. Both methods are explained here:

 
Upvote 0

Forum statistics

Threads
1,215,014
Messages
6,122,697
Members
449,092
Latest member
snoom82

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