Filter for Last 3 Days in Each Month

Littlemalky

Board Regular
Joined
Jan 14, 2011
Messages
223
Hi, I'm trying to build a query against a daily sales table that returns the sales for the last three days in each month for this year. I'm not sure how to create the function to limit just the last three days in each month. My purpose is to try to calculate the average daily sales in the last three days of the month to help us forecast where we will land.

Essentially, I want my results to show these columns: Date, Month, Sales.

example:

1/29/2016 | 1 | 50,000
1/30/2016 | 1 | 35,000
1/31/2016 | 1 | 42,000
2/27/2016 | 2 | 30,000
2/28/2016 | 2 | 15,000
2/29/2016 | 2 | 12,000
etc.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Add this Criteria under your Date field (assuming Date field is named "MyDate" - change it to match your date field name):
Code:
DateSerial(Year([MyDate]),Month([MyDate])+1,1)-[MyDate]<=3
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

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