# Filter for Last 3 Days in Each Month

#### Littlemalky

##### Board Regular
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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.
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``

Replies
19
Views
338
Replies
3
Views
208
Replies
4
Views
188
Replies
6
Views
200
Replies
4
Views
240

1,196,319
Messages
6,014,622
Members
441,832
Latest member
tony tessman

### 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.

### Which adblocker are you using?

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

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