filtering an Excel pivot table to show the last 24

2019-08-31 19:23发布

问题:

Is it possible to filter one of two Excel pivot tables to show the last 24 hours data from the current date/time?

I'm working with an Excel spreadsheet that has a series of dates as one of the columns, I've created two pivot tables from this data, one to show all the items since the start of the week, and another table that I'm trying to show the data for the last 24 hours from the current date/time. The simple function =NOW()-1 will give me the date and time 24 hours ago, but I cant find any way to filter the pivot table using this function.

I can filter by using the inbuilt date filters, but that only has set values from/to/today/yesterday/month/quarter/etc - just about every date range apart from 24 hours. The 'custom filter' only accepts a fixed date as the filter and wont accept a formula.

Sheet one has the data extracted from SQL containing all the records for the last week. Sheet two has two pivot tables based on this data, one showing all the records for the last week, and the other I'm trying to filter to show data for the last 24 hours from the current time.

I must be missing how to do this but cant find any way to filter by a dynamic date and would be grateful for help.

标签: sql excel pivot