Limit Dates in Pivot Table

G

Greg H.

I have a pivot table that I would like to limit to the previous weeks date
range. How can I code something that will filter out all dates other then
the previous weeks?

The pivot table structure will be rows of employee’s names, columns of Dates
and a count of transactions.

In an example for today, I would want a date range of 2/3 - 2/9. Then next
week it would list 2/10 - 2/16.

Thanks for the help.
 
C

Charles Chickering

Greg, other than unselecting all dates and selecting only the ones you want,
the only way to do this is to add a helper column with a calculation to
calculate weeks. Here's an example formula to add to your data set to give
you a column listing the previous week in the format of MM/DD/YYYY:

=TEXT(A1-7-(WEEKDAY(A1)-1),"MM/DD/YYYY") & " - " &
TEXT(A1-WEEKDAY(A1),"MM/DD/YYYY")

Be sure to remove all line breaks. Then add the new column as the page field
in the pivot table and select the week that you want. Let me know if you need
additional help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top