PivotTable filtering, how to check if a date exists, if not, then filter date -1

Norbi7454

New Member
Joined
Aug 15, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi All.

I need to make a macro that filters the last 6 dates from the current date in a specific pivot table (run rate calculation).

The problem is that you have to omit Sundays + check if there was a sale on Saturday, if so, we count Saturday, if it wasn't, then the day before. So 2 possible scenarios:

1. today August 16 (Monday) - I have to filter 14, 13, 12, 11, 10, 09 - there was a sale on Saturday

2. today 16.08 (Monday) - I have to filter 13, 12, 11, 10, 09, 07 or 06 - there was a sale on Saturday - but on an earlier Saturday it is possible that the sale was or was not

I don't know how to go about it .. :(
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,215,563
Messages
6,125,550
Members
449,237
Latest member
Chase S

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