Limit Dates in Pivot Table

  • Thread starter Thread starter Greg H.
  • Start date Start date
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.
 
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.
 
Back
Top